scrimba
Build Your First Angular app
Event Binding - Data Binding in Angular
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Event Binding - Data Binding in Angular
AboutCommentsNotes
Event Binding - Data Binding in Angular
Expand for more info
src
app
customers
customers-list
customers-list.component.ts
run
preview
console
import { Component, OnInit } from '@angular/core';

import { ICustomer } from '../../shared/interfaces';

@Component({
selector: 'app-customers-list',
templateUrl: './customers-list.component.html'
})
export class CustomersListComponent implements OnInit {

filteredCustomers: any[] = [];
customersOrderTotal: number;
currencyCode: string = 'USD';

constructor() {}

ngOnInit() {

}

calculateOrders() {
this.customersOrderTotal = 0;
this.filteredCustomers.forEach((cust: ICustomer) => {
this.customersOrderTotal += cust.orderTotal;
});
}
}
Console
"Angular is running in the development mode. Call enableProdMode() to enable the production mode."
,
customers
-2:38