typescript objects

@Component({
    template:`
 <h1>{{ title }} ({{title.length}})</h1>
 <input [(ngModel)]="title">
 <h2 *ngIf="title.length>15"> the title is long!!!</h2>
 <button (click)="click()">my button</button>
 <br/>
-Order: {{orderId}}<br/>
Order: {{order.orderId}}<br/>
-Customer: {{customerId}}
Customer: {{order.customerId}}

`
})

@Injectable()
export class AppComponent {
  
    title = 'Orders';
-   orderId = 5;
-   customerId = "abc";
    order = {
        orderId: 5,
        customerId: "abc"
    };
   
    click() {
        this.title += "button was clicked";
    }
} 

Commit info on GitHub


Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com