DEV Community

Discussion on: Explain Angular 5 like I'm five

Collapse
 
layzee profile image
Lars Gyrup Brink Nielsen

Similar concepts:
Props -> @Input and @Output properties
State -> Other properties
componentDidMount -> ngOnInit
componentWillUnmount -> ngOnDestroy
Higher-order components -> Attribute directives
shouldComponentUpdate returning false -> ChangeDetectionStrategy.OnPush

Angular uses constructor injection. It uses the TypeScript type of a constructor argument as a token to request a dependency from the app. Dependencies are configured using NgModules, providers and the component tree.

NgModules are the mechanism used to define which other components, directives and pipes that are available in a component's template. A component can only be declared by one NgModule. That NgModule imports other NgModules which have exported components, directives and pipes that are made available in the component template.