How to concatenate string with scope variable and assign it to ng-model
is there a way ti express this
ng-model="'is'+location.placeName+'Checked'"
How to concatenate string with scope variable and assign it to ng-model
is there a way ti express this
ng-model="'is'+location.placeName+'Checked'"
You can use ng-bind-model instead of ng-model in this case
ng-bind-model="is{{location.placeName}}Checked"
thanks
Finally found the answer randomly in this plunker by ozkary using ng-init
HTML View
<input ng-model="isPlaceChecked" ng-init="isPlaceChecked = checkIfPlaceChecked(location.placeName)"
JS Controller
$scope.checkIfPlaceChecked = function (placeName) {
return "is" + placeName + "Checked";
}