1

我在 typeScript 中使用 bower 组件时遇到问题。是否可以使用 bower_components. 我在 index.html 中导入 bower_component,但它不是为其他 .html 导入的。您能否为这个问题提供解决方案。

index.html 中的这个导入行。

 <link rel="import" href="bower_components/...html" />

谢谢你。

4

1 回答 1

0

查看您的错误是否说明添加 CUSTOM_ELEMENTS_SCHEMA 然后您可以将其添加到您的 AppModule

schemas: [CUSTOM_ELEMENTS_SCHEMA]

@NgModule({
    declarations: [ HeaderComponent ],
    bootstrap:    [ HeaderComponent ],
    imports: [ RouterModule, CommonModule, FormsModule ],
    schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class AppModule { }
于 2016-12-07T08:02:45.863 回答