大佬教程收集整理的这篇文章主要介绍了angular 2:TypeError:this.form.updateValueAndValidity不是函数,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
所以我升级到rc.4并尝试使用新的forms-api.这就是我得到的:
“TypeError:this.form.updateValueAndValidity不是函数”
上述错误消息对任何人都有意义吗?
谢谢
编辑:
好的,源代码毕竟:
异常来自angular中的文件“form_group_directive.js”:
FormGroupDirective.prototype.ngOnChanges = function (changes) { this._checkFormPresent(); if (collection_1.StringMapWrapper.contains(changes,'form')) { var sync = shared_1.composeValidators(this._validators); this.form.validator = validators_1.Validators.compose([this.form.validator,sync]); var async = shared_1.composeAsyncValidators(this._asyncValidators); console.log('from within angular:---------------------------------------------------------------------------------------------------'); console.log(this.form); this.form.asyncValidator = validators_1.Validators.composeAsync([this.form.asyncValidator,async]); this.form.updateValueAndValidity({ onlySelf: true,emitEvent: false }); }
console.log-statement的输出是一个“FormGroupDirective”,它没有一个名为“updateValueAndValidity”的方法
以上是大佬教程为你收集整理的angular 2:TypeError:this.form.updateValueAndValidity不是函数全部内容,希望文章能够帮你解决angular 2:TypeError:this.form.updateValueAndValidity不是函数所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。