简体   繁体   English

ngx-responsive - 无法绑定到“responsive-window”,因为它不是“div”的已知属性

[英]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.

相关问题 错误:无法绑定到“ ngModel”,因为它不是的已知属性 - Error: Can't bind to 'ngModel' since it isn't a known property of Angular 11.0.3 中的 ngClass 错误(无法绑定 ngClass,因为它不是 div 的已知属性) - ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3 “无法绑定到&#39;ngFor&#39;,因为它不是已知的本机属性” - “Can't bind to 'ngFor' since it isn't a known native property” Angular 6 无法绑定到“*ngIf”,因为它不是已知属性 - Angular 6 Can't bind to '*ngIf' since it isn't a known property 无法绑定到itemprop,因为它不是&#39;a&#39;的已知属性 - Can't bind to itemprop since it isn't a known property of 'a' 无法绑定到“ngForOf”,因为它不是“div”的已知属性。 ngFor 不在浏览器中显示任何内容 - Can't bind to 'ngForOf' since it isn't a known property of 'div'. ngFor not displaying anything in the browser Angular 6 日历模板解析错误:无法绑定到“视图”,因为它不是“div”的已知属性 - Angular 6 Calendar Template parse errors: Can't bind to 'view' since it isn't a known property of 'div' 无法绑定到“x”,因为它不是“输入”Angular 2 的已知属性 - Can't bind to 'x' since it isn't a known property of 'input' Angular 2 无法绑定到“数据介绍”,因为它不是“按钮”的已知属性 - Can't bind to 'data-intro' since it isn't a known property of 'button' Angular9-MatDatePicker:无法绑定到“ngModel”,因为它不是“输入”的已知属性 - Angular9-MatDatePicker: Can't bind to 'ngModel' since it isn't a known property of 'input'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM