Please enable JavaScript.
Coggle requires JavaScript to display documents.
Angular 2 (Esentitals (Components
A component is a directive-with-a…
Angular 2
Esentitals
Metadata
declarations
the view classes that belong to this module. Angular has three kinds of view classes: components, directives, and pipes.
exports
the subset of declarations that should be visible and usable in the component templates of other modules.
imports
other modules whose exported classes are needed by component templates declared in this module.
providers
creators of services that this module contributes to the global collection of services; they become accessible in all parts of the app.
bootstrap
the main application view, called the root component, that hosts all other app views. Only the root module should set this bootstrap property.
Bootstrappingimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';platformBrowserDynamic().bootstrapModule(AppModule);
-
-
ComponentsA component is a directive-with-a-template.
A '@Component decorator is actually a
'@Directive decorator extended with template-oriented features.
-
-
-
-
-
Templates
Data Binding
-
-
-
-
Directives
-
Kinds of directives
structural directives (ngFor, ngIf))
alter layout by adding, removing, and replacing elements in DOM
-
-
Services
Dependency Injection
- Dependency injection is wired into the Angular framework and used everywhere.
- The injector is the main mechanism.
- An injector maintains a container of service instances that it created.
- An injector can create a new service instance from a provider.
- A provider is a recipe for creating a service.
- Register providers with injectors.
-
-
-
-
-
-