2017-03-09 10 views

答えて

0

あなたは

import {Component, NgModule} from '@angular/core' 
import {BrowserModule} from '@angular/platform-browser' 

@Component({ 
    selector: 'my-app', 
    template: ` 
    <div> 
     <h2>{{name}} Sample</h2> 
     {{myConfiguration | json}} 
    </div> 
    `, 
}) 
export class App { 
    name:string; 
    myConfiguration:any=myConfiguration; 
    constructor() { 
    console.log(myConfiguration); 
    this.name = 'Global Configuration' 
    } 
} 

@NgModule({ 
    imports: [ BrowserModule ], 
    declarations: [ App ], 
    bootstrap: [ App] 
}) 
export class AppModule { 
    var myConfiguration={id:1,devmode:true}; 

} 

LIVE DEMO

+0

次のように自分のメインモジュールクラスでのindex.htmlでこれを行うには方法は、あなたの設定を持つことはできませんか? – reza

関連する問題