2016-04-20 16:32:12 +03:00
|
|
|
/*
|
|
|
|
|
* Angular 2 decorators and services
|
|
|
|
|
*/
|
|
|
|
|
import {Component, ViewEncapsulation} from 'angular2/core';
|
|
|
|
|
import {RouteConfig, Router} from 'angular2/router';
|
|
|
|
|
|
2016-04-21 20:34:07 +03:00
|
|
|
import {Pages} from './pages';
|
2016-04-20 16:32:12 +03:00
|
|
|
|
2016-04-28 13:08:33 +03:00
|
|
|
// TODO: is it really the best place to globally require that dependency?
|
|
|
|
|
require("!style!css!sass!./theme/sass/_ionicons.scss");
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* App Component
|
|
|
|
|
* Top Level Component
|
2016-04-28 15:08:48 +03:00
|
|
|
* TODO: whey the header and footer are not implemented?
|
2016-04-28 13:08:33 +03:00
|
|
|
*/
|
2016-04-20 16:32:12 +03:00
|
|
|
@Component({
|
|
|
|
|
selector: 'app',
|
|
|
|
|
pipes: [ ],
|
|
|
|
|
providers: [ ],
|
|
|
|
|
encapsulation: ViewEncapsulation.None,
|
2016-04-21 17:41:28 +03:00
|
|
|
styles: [ require('normalize.css'), require('./app.scss') ],
|
2016-04-20 16:32:12 +03:00
|
|
|
template: `
|
|
|
|
|
<header>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<main>
|
|
|
|
|
<router-outlet></router-outlet>
|
|
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<footer>
|
|
|
|
|
</footer>
|
|
|
|
|
`
|
|
|
|
|
})
|
|
|
|
|
@RouteConfig([
|
2016-04-21 20:34:07 +03:00
|
|
|
{
|
2016-04-28 15:08:48 +03:00
|
|
|
path: '/pages/...',
|
2016-04-21 20:34:07 +03:00
|
|
|
name: 'Pages',
|
|
|
|
|
component: Pages,
|
|
|
|
|
useAsDefault: true
|
|
|
|
|
},
|
2016-04-20 16:32:12 +03:00
|
|
|
])
|
|
|
|
|
export class App {
|
|
|
|
|
angularclassLogo = 'assets/img/angularclass-avatar.png';
|
|
|
|
|
name = 'Angular 2 Webpack Starter';
|
|
|
|
|
url = 'https://twitter.com/AngularClass';
|
|
|
|
|
|
2016-04-22 13:15:25 +03:00
|
|
|
constructor() {}
|
2016-04-20 16:32:12 +03:00
|
|
|
|
|
|
|
|
ngOnInit() {
|
2016-04-22 13:15:25 +03:00
|
|
|
console.log('Initial App State');
|
2016-04-20 16:32:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Please review the https://github.com/AngularClass/angular2-examples/ repo for
|
|
|
|
|
* more angular app examples that you may copy/paste
|
|
|
|
|
* (The examples may not be updated as quickly. Please open an issue on github for us to update it)
|
|
|
|
|
* For help or questions please contact us at @AngularClass on twitter
|
|
|
|
|
* or our chat on Slack at https://AngularClass.com/slack-join
|
|
|
|
|
*/
|