3
votes

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.

1
Apparently that's not an officially-valid attribute of input elements. - jonrsharpe
List of valid input attributes: w3c.github.io/html/sec-forms.html#the-input-element - BSMP
Where's your code? - developer033
Sorry it was not displayed before I have added that - kalyan Chatterjee

1 Answers

8
votes

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