Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular2 W3C validation error for providing formControlName attribute

Tags:

angular

w3c

In one of the Angular2 Application I have used a formControlName attribute in an input field with formgroup the the form.

Example :
input formControlName="Searchbycombo" class="customcombocontrol" type="text" name="Searchbycombo" id="ctry"

But when I try to validate the page, W3c validator providing some error

"Attribute formcontrolname not allowed on element input at this point."

I have already gone through this url but no luck https://angular.io/docs/ts/latest/guide/template-syntax.html#!#other-bindings

any idea how to fix the same.

like image 379
kalyan Chatterjee Avatar asked Aug 30 '26 13:08

kalyan Chatterjee


1 Answers

Hi Today I have received a reply form Angular team and they mentioned to use the below way

[formControlName]="'Searchbycombo'"

and its no longer giving any error on w3c validator after render.

Thanks all for the support and help

like image 75
kalyan Chatterjee Avatar answered Sep 02 '26 04:09

kalyan Chatterjee