'block-ui'不是已知元素:

时间:2018-06-01 08:34:52

标签: angular angular6 blockui angular-cli-v6

目前,我正在开展angular6的项目, 我正确配置了ng-block-ui(我已经在angular5中的一个项目中使用了ng-block-ui),但是在组件模板中绑定时,我面临着如下ng-block-ui的问题

block-ui' is not a known element:
1. If 'block-ui' is an Angular component, then verify that it is part of this module.
2. If 'block-ui' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
[ERROR ->]<block-ui>
 <!-- Your app markup here -->
</block-ui>
"): ng:///HtmlLayoutModule/AdminComponent.html@0:0
Error: Template parse errors:

这是我正在使用的版本

"ng-block-ui": "^1.0.4",
"primeng": "^6.0.0-alpha.1",
"rxjs": "^6.2.0",
"rxjs-compat": "^6.2.0",

2 个答案:

答案 0 :(得分:0)

截至目前ng-block-ui RxJS 6 不兼容。 您可以尝试使用rxjs-compact来确保向后兼容性。 有关详细信息,请访问此链接:https://github.com/kuuurt13/ng-block-ui/issues/61

答案 1 :(得分:-1)

import { BlockUIModule } from 'ng-block-ui';

@NgModule({
    BlockUIModule.forRoot()
  ]
})

import blockui in module.ts