Is a "pseudonym" a reserved word?

I am using Angular 2 and Typescript. I have a component with this property declared.

alias: string;

When I try to snap this to an input tag in my template, use this.

<input class="form-control" type="text" required
                        [(ngModel)]="alias" ngControl="alias" #alias="ngForm" />

When I run this code, I get an error message:

angular2.dev.js: 23925 EXCLUSION: Error: unclean (in promise): cannot reassign variable binding alias

If I change the property name from 'alias' to 'nameOrAlias', everything will work without errors. Why?

+4
source share
1 answer

Cannot reassign variable binding alias ...

, alias:

<input class="form-control" type="text" required
       [(ngModel)]="alias" ngControl="alias" #alias="ngForm" />
                                             <!-- ^--- "alias" reasignment -->

, , .

+5

All Articles