javascript - angularjs - ng-model input as string -


in angularjs have code:

<input type="text" ng-model="properties.foreground.value"> 

i want like:

<input type="text" ng-model="properties.{{type}}.value"> 

i changed part of model input string. not work. can done other way?

you need use bracket notation access property , not dot notation. because ngmodel binds attirbute scope using =, value not interpolated.

<input type="text" ng-model="properties[type].value"> 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -