我正在使用Angular 6与golden layout,遵循this tutorial。
在
在
GoldenLayoutModule.forRoot(config)
上出现错误。
config不能分配给类型为
GoldenLayoutConfiguration
的参数。
import { AppComponent } from './app.component';
import { GoldenLayoutModule, GoldenLayoutConfiguration } from '@embedded-enterprises/ng6-golden-layout';
import * as $ from 'jquery';
// It is required to have JQuery as global in the window object.
window['$'] = $;
// const config: GoldenLayoutConfiguration { /* TODO */ };
let config = {
content: [{
type: 'row',
content:[{
type: 'component',
componentName: 'testComponent',
componentState: { label: 'A' }
},{
type: 'column',
content:[{
type: 'component',
componentName: 'testComponent',
componentState: { label: 'B' }
},{
type: 'component',
componentName: 'testComponent',
componentState: { label: 'C' }
}]
}]
}]
};
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
GoldenLayoutModule.forRoot(config)
],
entryComponents: [
// TODO Add your components which are used as panels in golden-layout also here.
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
config
是错误的类型。它需要是GoldenLayoutConfiguration
,但似乎不是这种类型。它是什么类型? - Travis Heeter