Break the ice
ng new my-project
ng serve -o
ng generate component
ng update
import { NgModule } from '@angular/core';
import { NameComponent } from './name.component';
@NgModule({
imports: [],
exports: [],
declarations: [NameComponent],
providers: [],
})
export class NameModule { }
<div>
<div class="header">
<h2>My Angular App</h2>
</div>
<div class="content">
<label for="name">Name</label>
<input id="name" type="text" [(ngModel)]="name">
<p>Those people passed by:</p>
<ul>
<li*ngFor="let name of list">
{{name}}
</li>
</ul>
</div>
<div class="footer" [disabled]="!name">
<button *ngIf="name" (click)="greet()">Greet</button>
</div>
</div>
import { Component, OnInit } from '@angular/core';
@Component({
moduleId: module.id,
selector: 'selector',
templateUrl: 'feature.component.html'
})
export class FeatureComponent implements OnInit {
constructor() { }
ngOnInit() { }
}
import { Injectable } from '@angular/core';
@Injectable()
export class ServiceNameService {
constructor() { }
}
[attribute]="expression"
(event)="callback"
[(ngmodel)]="variable"
{{variable}}
*ngIf="expression"
*ngFor="let <var> of <array>"
Thank you