import logo from '../assets/img/angularclass-logo.png' /* * Angular 2 decorators and services */ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { AppState } from './app.service'; /* * App Component * Top Level Component */ @Component({ selector: 'app', encapsulation: ViewEncapsulation.None, styleUrls: [ './app.component.css' ], template: `
this.appState.state = {{ appState.state | json }}
` }) export class AppComponent implements OnInit { // TODO: figure out how to prefix this correctly public angularclassLogo = logo; public name = 'Angular 2 Webpack Starter'; public url = 'https://twitter.com/AngularClass'; constructor( public appState: AppState ) {} public ngOnInit() { console.log('Initial App State', this.appState.state); } } /* * 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 */