【问题标题】:How do fix Error in angular code two binding如何修复角码两个绑定中的错误
【发布时间】:2021-07-14 23:12:33
【问题描述】:

使用两个绑定时出现错误

TS2339:“用户组件”类型上不存在属性“asd”

注意:我在 App 中添加了 FormsModule。模块页面。

所以我不知道是什么问题??

【问题讨论】:

  • 您是否在代表您的组件的类中声明了“asd”?错误告诉你你没有或者可能有错字
  • 需要模板和TS类代码

标签: angular xcode binding angular-ngmodel ngmodel


【解决方案1】:

此错误意味着在您的组件“用户组件”中,您没有声明名为“asd”的变量

做事

export class UsersComponent implements OnInit {

 asd: string;

 constructor() {}

 ngOnInit(): void {
 }
}

【讨论】:

  • 谢谢.. 在这种情况下,我看到了很多关于这项技术的视频,并且它在没有声明变量的情况下工作
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-12-08
  • 1970-01-01
  • 2015-08-18
  • 1970-01-01
  • 1970-01-01
  • 2013-03-12
相关资源
最近更新 更多