0
入力パラメータ、設定パラメータをindex.htmlに記載されていないコンポーネントに設定する必要があります。index.htmlファイルから角度2のコンポーネントに入力パラメータを渡す方法
私は、index.htmlに含まれているコンポーネントセレクタについてこれを行う方法を知ることができます。
index.htmlからどうやったらいいですか?
入力パラメータ、設定パラメータをindex.htmlに記載されていないコンポーネントに設定する必要があります。index.htmlファイルから角度2のコンポーネントに入力パラメータを渡す方法
私は、index.htmlに含まれているコンポーネントセレクタについてこれを行う方法を知ることができます。
index.htmlからどうやったらいいですか?
あなたは
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};
}
次のように自分のメインモジュールクラスでのindex.htmlでこれを行うには方法は、あなたの設定を持つことはできませんか? – reza