angular

Guide Angular NgModule patterns for non-standalone components and lazy-loaded routes.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/sebasmzg/sebas.dot --skill angular-sebasmzg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular
Source: https://github.com/sebasmzg/sebas.dot/tree/main/.config/opencode/skill/angular
Command: npx skills add https://github.com/sebasmzg/sebas.dot --skill angular-sebasmzg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

Provides clear patterns and templates to avoid common architectural mistakes when building Angular applications with non-standalone components and NgModule-based organization, reducing runtime errors and module misuse.

Core Features & Use Cases

  • Best-practice guidance for declaring components, directives, and pipes in the correct NgModule to prevent duplicate declarations.
  • Patterns for service provisioning choices including providedIn scopes and module-level providers, plus lazy-loading guidance to improve performance.
  • Ready-to-use templates for components, feature modules, and services to accelerate feature scaffolding; example: create a UserModule with routing, shared components in a SharedModule, and singletons in a CoreModule.

Quick Start

Use the angular skill to get NgModule patterns, templates, and a short checklist for converting components and services into a feature module.

Frequently Asked Questions about angular

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize Angular NgModules for feature, shared, and core modules?

Organize Angular NgModules by declaring components in feature modules, placing shared components in a SharedModule, and providing singletons in a CoreModule. This separation prevents duplicate declarations and ensures proper module-level provider scoping for non-standalone components.

When should I use BrowserModule versus CommonModule in Angular modules?

Use BrowserModule only in the root AppModule to enable critical application providers, and use CommonModule in feature modules to access common directives like ngIf and ngFor. This distinction prevents runtime errors and ensures correct module initialization.

How do I implement lazy-loaded routes with loadChildren in an Angular feature module?

Implement lazy-loaded routes by using the loadChildren property in your routing configuration to dynamically import the feature module. This pattern defers module initialization until navigation, improving application performance.

What is the best way to configure service providers using providedIn in Angular?

Configure service providers using the providedIn property within the @Injectable decorator to define scoping. Choosing providedIn: 'root' creates a singleton service, while module-level providers restrict availability to that specific NgModule.

Why am I getting duplicate declaration errors with Angular NgModule components?

Duplicate declaration errors occur when an Angular component, directive, or pipe is declared in multiple NgModules. Resolve this by declaring each component in a single feature or shared module and importing that module where needed.

Can I use NgModule patterns for non-standalone Angular components?

Yes, NgModule patterns are specifically designed for non-standalone Angular components. This approach provides structured templates for component declarations, service provisioning, and routing within a modular architecture.