Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 1 | import { Component, OnInit } from '@angular/core'; |
| 2 | import { SdcService } from '../services/sdc.service'; |
| 3 | import { DataService } from '../services/data.service'; |
| 4 | |
| 5 | @Component({ |
| 6 | selector: 'my-home', |
| 7 | templateUrl: './home.component.html', |
| 8 | styleUrls: ['./home.component.scss'], |
| 9 | providers: [SdcService, DataService] |
| 10 | }) |
| 11 | export class HomeComponent implements OnInit { |
| 12 | |
| 13 | constructor(private _sdcService: SdcService) { |
| 14 | // Do stuff |
| 15 | } |
| 16 | |
| 17 | ngOnInit() { |
| 18 | console.log('Hello Home'); |
| 19 | console.log('getServicesModels: '); |
| 20 | this._sdcService.getServicesModels().subscribe( |
| 21 | // onNext() function |
| 22 | value => console.log('value is ', value), |
| 23 | // onError() function |
| 24 | error => console.log('error is ', error), |
| 25 | // onComplete() function |
| 26 | () => console.log('completed') |
| 27 | ); |
| 28 | } |
| 29 | |
| 30 | } |