diff --git a/steps/binding-solution/src/app/_static/people.ts b/steps/binding-solution/src/app/_static/people.ts index f99fbe6a..908e83ae 100755 --- a/steps/binding-solution/src/app/_static/people.ts +++ b/steps/binding-solution/src/app/_static/people.ts @@ -1,4 +1,6 @@ -export const PEOPLE = [ +import { People } from '../people.model'; + +export const PEOPLE: People[] = [ { id: '5763cd4d9d2a4f259b53c901', photo: 'https://randomuser.me/portraits/women/59.jpg', diff --git a/steps/binding-solution/src/app/home/home.component.ts b/steps/binding-solution/src/app/home/home.component.ts index 456f0272..4f84012f 100755 --- a/steps/binding-solution/src/app/home/home.component.ts +++ b/steps/binding-solution/src/app/home/home.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { PEOPLE } from '../_static/people'; +import { People } from '../../../../binding/src/app/people.model'; @Component({ selector: 'sfeir-home', @@ -7,7 +8,7 @@ import { PEOPLE } from '../_static/people'; styleUrls: ['home.component.css'] }) export class HomeComponent implements OnInit { - private person: any; + person: People; constructor() { this.person = PEOPLE[0]; diff --git a/steps/binding-solution/src/app/people.model.ts b/steps/binding-solution/src/app/people.model.ts new file mode 100644 index 00000000..ca6fd797 --- /dev/null +++ b/steps/binding-solution/src/app/people.model.ts @@ -0,0 +1,35 @@ +interface foo { + bar: number; +} + +export class People implements foo { + id: string; + photo: string; + firstname: string; + lastname: string; + entity: string; + entryDate: string; + birthDate: string; + gender: string; + email: string; + skills: string[]; + geo: { + lat: number; + lng: number; + }; + phone: string; + address: { + street: string; + postalCode: number; + city: string; + }; + links: { + twitter: string; + slack: string; + github: string; + linkedin: string; + }; + isManager: boolean; + manager: string; + managerId: string; +} diff --git a/steps/binding/src/app/_static/people.ts b/steps/binding/src/app/_static/people.ts index f99fbe6a..908e83ae 100644 --- a/steps/binding/src/app/_static/people.ts +++ b/steps/binding/src/app/_static/people.ts @@ -1,4 +1,6 @@ -export const PEOPLE = [ +import { People } from '../people.model'; + +export const PEOPLE: People[] = [ { id: '5763cd4d9d2a4f259b53c901', photo: 'https://randomuser.me/portraits/women/59.jpg', diff --git a/steps/binding/src/app/home/home.component.ts b/steps/binding/src/app/home/home.component.ts index 987e3e58..38bedf15 100644 --- a/steps/binding/src/app/home/home.component.ts +++ b/steps/binding/src/app/home/home.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { People } from '../people.model'; @Component({ selector: 'sfeir-home', @@ -7,6 +8,7 @@ import { Component, OnInit } from '@angular/core'; }) export class HomeComponent implements OnInit { name: string; + people: People; constructor() { this.name = 'Angular'; diff --git a/steps/binding/src/app/people.model.ts b/steps/binding/src/app/people.model.ts new file mode 100644 index 00000000..1f24582b --- /dev/null +++ b/steps/binding/src/app/people.model.ts @@ -0,0 +1,31 @@ +export interface People { + id: string; + photo: string; + firstname: string; + lastname: string; + entity: string; + entryDate: string; + birthDate: string; + gender: string; + email: string; + skills: string[]; + geo: { + lat: number; + lng: number; + }; + phone: string; + address: { + street: string; + postalCode: number; + city: string; + }; + links: { + twitter: string; + slack: string; + github: string; + linkedin: string; + }; + isManager: boolean; + manager: string; + managerId: string; +}