blob: b67e7f634de2859317d704f0b6d70a2755b524f8 [file] [log] [blame]
Matteo Scandolo43ffb672016-12-02 14:49:58 -08001/// <reference path="../../typings/index.d.ts"/>
2import {Component, OnInit} from '@angular/core';
3import {NgFor} from '@angular/common';
4import {StyleConfig} from './config/style.config';
5import {CoreService} from './services/rest/core.service';
Matteo Scandolod819c922016-12-02 14:06:14 -08006
7@Component({
Matteo Scandolo43ffb672016-12-02 14:49:58 -08008 selector: 'xos-app',
9 template: require('./hello.html'),
10 providers: [CoreService],
Matteo Scandolod819c922016-12-02 14:06:14 -080011})
12export class HelloComponent {
Matteo Scandolod819c922016-12-02 14:06:14 -080013
Matteo Scandolo43ffb672016-12-02 14:49:58 -080014 // declare class properties
15 public hello: string;
16 public endpoints: any[];
17
18 constructor(private coreService: CoreService) {
19 this.hello = `Hello ${StyleConfig.projectName}!`;
20 this.endpoints = [];
21 }
22
23 ngOnInit() {
24 console.log('on init');
25 this.coreService.getCoreEndpoints()
26 .subscribe(
27 endpoints => {
28 this.endpoints = endpoints
29 },
30 err => console.log
31 )
Matteo Scandolod819c922016-12-02 14:06:14 -080032 }
33}