How to setup Angular project and generate components ?
- install latest nodejs from nodejs.org
- Go to git bash/powershell ISE/CMD
- type following commands,
- install Angular : npm install -g @angular/cli
- ng new my-newweb-app
- ng g c myFirstModule or type mg generate component myFirstModule (optional)
- go to project folder ” my-newweb-app ” via commandline itself
- type mg serve -o
Other programming notes
select [(ngModel)]=”value” (change)=”selected()”
option *ngFor=”let item of data” [ngValue]=”item”>{{item.name}}</option
</select
selected(){
alert(this.value.name)
}
data:Array = [
{id: 0, name: “Test “},
{id: 1, name: “Test2”}
];
div> <input ref-email placeholder=”text here” /> </div