How to set attribute 'value' based on $ sc...">

Dynamically set text on an input button with Angular

<input type="submit" value="Create new order" /> 

How to set attribute 'value' based on $ scope variable?

+4
source share
2 answers

http://plnkr.co/edit/DZWzN4D9QzzBCpetSYtF?p=preview

 <input type="submit" value="{{model}}" /> 

In your controller:

 $scope.model = "Create new order"; 
+7
source

Same:

 <input type="submit" value="{{scopeVar}}" /> $scope.scopeVar = "some value"; 
+1
source

Source: https://habr.com/ru/post/1497082/


All Articles