Data binding error: property is not defined
Data binding error: property is not defined
我已按照 Nativescript/Angular 中创建数据输入表单的教程进行操作。但是,控制台没有触发控制台日志,而是告诉我我希望打印的 属性 未定义。
下面操场上的示例。服务和 appSettings 存储功能已被删除。
错误在您的 console.log() 中,您需要使用 this
引用组件内部的属性和方法
因此您的日志行应该是 console.log("Logging in as ", this.name);
,因为它指的是您组件的 属性,在本例中是 this
。
我已按照 Nativescript/Angular 中创建数据输入表单的教程进行操作。但是,控制台没有触发控制台日志,而是告诉我我希望打印的 属性 未定义。
下面操场上的示例。服务和 appSettings 存储功能已被删除。
错误在您的 console.log() 中,您需要使用 this
因此您的日志行应该是 console.log("Logging in as ", this.name);
,因为它指的是您组件的 属性,在本例中是 this
。