[英]ngx-responsive - Can't bind to 'responsive-window' since it isn't a known property of 'div'
I am using the npm ngx-responsive.我正在使用 npm ngx-responsive。
In my app.module I have imported the module (after the npm install)在我的 app.module 中,我已经导入了模块(在 npm 安装之后)
import { ResponsiveModule } from 'ngx-responsive'
@NgModule({
imports: [
ResponsiveModule.forRoot()
],
})
In my HTML I a have a sample code for rendering a在我的 HTML 中,我有一个示例代码用于呈现
<div [responsive-window]="'parent'">
<p *responsive="{ sizes:{ window: 'parent', min:100, max:600} }"></p>
</div>
I still get a error that it can't be bind because it's not a property of div.我仍然收到无法绑定的错误,因为它不是 div 的属性。 And the same problem with the paragraph element
和段落元素同样的问题
Can someone help me...有人能帮我吗...
In app.module在 app.module 中
import { NgModule } from '@angular/core'
import { ResponsiveModule } from 'ngx-responsive'
const config = {
breakPoints: {
xs: {max: 600},
sm: {min: 601, max: 959},
md: {min: 960, max: 1279},
lg: {min: 1280, max: 1919},
xl: {min: 1920}
},
debounceTime: 100
};
@NgModule({
imports: [
BrowserModule,
ResponsiveModule.forRoot(config)
],
declarations: [
AppComponent
],
providers:[]
})
HTML HTML
<div [responsive-window]="'parent'">
<p *responsive="{ sizes:{ window: 'parent', min:900, max:1400} }"></p>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.