/
app.ts
44 lines (39 loc) · 1.45 KB
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
///<reference path="../../typings/app.d.ts"/>
import {Component} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {FORM_PROVIDERS} from 'angular2/common';
import {HTTP_PROVIDERS} from 'angular2/http';
import '../style/app.scss';
import {Api} from './services/api/api';
import {Home} from './components/home/home';
import {About} from "./components/about/about";
import {CommBroker} from "./services/CommBroker";
/*
* App Component
* Top Level Component
*/
@Component({
selector: 'app', // <app></app>
providers: [...FORM_PROVIDERS, Api, HTTP_PROVIDERS, CommBroker],
directives: [...ROUTER_DIRECTIVES],
styles: [require('./app.scss')],
template: require('./app.html')
})
@RouteConfig([
{path: '/', component: Home, name: 'Home'},
{path: '/About', component: About, name: 'About'}
])
export class App {
url: string = 'https://github.com/ocombe/ng2-webpack';
constructor(public api: Api, private commBroker:CommBroker) {
console.log('Hello 23' + api);
//var userLang = navigator.language.split('-')[0]; // use navigator lang if available
//userLang = /(fr|en)/gi.test(userLang) ? userLang : 'en';
//
//// this will load translate json files from src/public/i18n
//translate.useStaticFilesLoader();
//
//// the lang to use, if the lang isn't available, it will use the current loader to get them
//translate.use(userLang);
}
}