Expected 2 arguments, but got 1.ts(2554) core.d.ts(8064, 47): An argument for 'opts' was not provided

南楼画角 提交于 2019-12-05 20:20:44

That is because of breaking change in new Angular. You need to pass like below

@ViewChild("password", { static: true }) password: ElementRef;
@ViewChild("confirmPassword", { static: true }) confirmPassword: ElementRef;

A new static flag has been introduced to not break existing applications, so if you want to keep the old behavior even when you’ll switch to Ivy, you can write:

@ViewChild('password', { static: true }) static: ElementRef<HTMLDivElement>;

You can further read here : https://angular.io/api/core/ViewChild#description

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!