Jul 20, 2024
npm install -g @angular/cling new project-nameng servepackage.json: NPM dependenciestsconfig.json: TypeScript configurationangular.json: Angular related configurationsrc folder, specifically the app folder@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
// logic here
}
<app-root></app-root>)@NgModule({
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {}
<input [(ngModel)]="someValue">
<input [(ngModel)]="someValue">
<button (click)="addValue()">Add</button>
<table>
<tr *ngFor="let val of values"><td>{{ val }}</td></tr>
</table>
export class AppComponent {
someValue: string;
values: string[] = [];
addValue() {
this.values.push(this.someValue);
this.someValue = '';
}
}