Say I have a button:
<button type="submit"
value="Send"
id="btnStoreToDB"
class="btn btn-primary start"
ng-click="storeDB()"
ng-disabled="!storeDB_button_state"
>
<i class="icon-white icon-share-alt"></i>
<span>Store to DB</span>
</button>

In JS, to get this button, I just do var btn = $('#btnStoreToDB');and now I can play with this button. So I can take it idor class.
But how can I get this item using angularjs?
I want to add a spinner to the button at boot time, as shown here (Fiddle) .
Since my whole project I started using angulajs, I try to do it wisely and do not like how I know.
I thought to add: ng-model="btnStoreToDB"and use this:
if($scope.btnStoreToDB){
var spinner = new Spinner().spin();
$scope.btnStoreToDB.appendChild(spinner.el);
}
but $scope.btnStartUpload- undefined. Suppose there is another way to get this button.
Please, help
source
share