小编Paw*_*wel的帖子

在核心模块中导入时,BrowserAnimationsModule不起作用

我将更大的应用程序划分为模块(功能模块,核心模块和共享模块).我正在使用Angular Material,因此我导入了BrowserAnimationsModule.我把它放在共享模块中,一切正常,但是当我想延迟加载一些功能模块时出现问题 - 然后我有关于双重导入BrowserModules的错误.我知道BrowserAnimationsModule应该由Core Module导入,但是当我尝试这样做时,我会收到以下错误:

Uncaught Error: Template parse errors:
Can't bind to 'ngForOf' since it isn't a known property of 'mat-option'.
1. If 'mat-option' is an Angular component and it has 'ngForOf' input, then verify that it is part of this module.
2. If 'mat-option' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("' | …
Run Code Online (Sandbox Code Playgroud)

module lazy-loading typescript angular

2
推荐指数
1
解决办法
1966
查看次数

标签 统计

angular ×1

lazy-loading ×1

module ×1

typescript ×1