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