Components Flashcards
@Component
The @Component decorator identifies the class immediately below it as a component class, and specifies its metadata.
setInterval()
JavaScript API let you run a function at regular time intervals
ngFor
*ngFor=”let phoneNumber of user.phone”
ngIf
*ngIf=”user.phone.length”
Lifecycle of Angular hooks
https://angular.io/guide/lifecycle-hooks#lifecycle-event-sequence
Create a new project
ng new project-name
Create a new component
ng
Click event handling
<span>Expand</span>
<span>Collapse</span>
Two way data binding
Use [(ngModel)]
{{inputText}}
Also import FormsModule in NgModule
import { FormsModule } from ‘@angular/forms’;
Create new module
ng generate module module-name
@NgModule
Angular Module
@Injectable
Angular Service