scrimba
Build Your First Angular app
Angular Services and Http - Creating and Providing a Service
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

Angular Services and Http - Creating and Providing a Service
AboutCommentsNotes
Angular Services and Http - Creating and Providing a Service
Expand for more info
src
app
customers
customers.component.ts
run
preview
console
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-customers',
templateUrl: './customers.component.html'
})
export class CustomersComponent implements OnInit {
title: string;
people: any[];

constructor() {}

ngOnInit() {
this.title = 'Customers';
this.people = [
{ id: 1, name: 'john Doe', city: 'Phoenix', orderTotal: 9.99, customerSince: new Date(2014, 7, 10) },
{ id: 2, name: 'Jane Doe', city: 'Chandler', orderTotal: 19.99, customerSince: new Date(2017, 2, 22)},
{ id: 3, name: 'Michelle Thomas', city: 'Seattle', orderTotal: 99.99, customerSince: new Date(2002, 10, 31)},
{ id: 4, name: 'Jim Thomas', city: 'New York', orderTotal: 599.99, customerSince: new Date(2002, 10, 31)},
];
}
}
Console
"Angular is running in the development mode. Call enableProdMode() to enable the production mode."
,
customers
-6:52