javascript - Get AngularJS object property name in the markup -
let's have object:
$scope.golovkin = { id:12, like:0, dislike:0, url:"https://twitter.com/gggboxing" };
and in view have button:
<input type="button" value="like" ng-click="incrementlikes(golovkin)" />
how replace value
of button property name of $scope.golovkin.like
string?
<input type="button" ng-model="golovkin.like" ng-click="incrementlikes(golovkin)" />
Comments
Post a Comment