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

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -