Using Angular directives
We have already built our simple "Hello world!" app. Now, let's start building something that is closer to a real-life application. By the end of this section, we'll have a simple application that lists a number of items we need to do and greets us at the header of the page.
Let's start by developing our app
component. The two modifications from the preceding example that we need to make are renaming the target
property to name
and adding a list of todos
to the component's controller definition:
// ch4/ts/ng-for/detailed-syntax/app.ts import {Component, NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; @Component({ selector: 'app', templateUrl: './app.html', }) class App { todos: string[]; name: string; constructor() { this.name = 'John'; this.todos = ['Buy milk...