38 lines
676 B
TypeScript
38 lines
676 B
TypeScript
import { Injectable } from '@angular/core';
|
|
|
|
import { Contact } from './contact-model';
|
|
import { Observable, of } from 'rxjs';
|
|
|
|
const contact: Contact = {
|
|
name: {
|
|
firstName: 'John',
|
|
lastName: 'Public',
|
|
middleName: 'Q',
|
|
prefix: 'Mr',
|
|
suffix: 'III',
|
|
},
|
|
addresses: [
|
|
{
|
|
line_1: '123 Main Street',
|
|
city: 'New York',
|
|
state: 'NY',
|
|
postalCode: '12345',
|
|
},
|
|
{
|
|
line_1: '123 South Street',
|
|
city: 'Boston',
|
|
state: 'MA',
|
|
postalCode: '54321',
|
|
},
|
|
],
|
|
};
|
|
|
|
@Injectable()
|
|
export class ContactService {
|
|
constructor() { }
|
|
|
|
public loadContact(): Observable<Contact> {
|
|
return of({...contact});
|
|
}
|
|
}
|