In my angular application, I have some buttons that call REST services.
Sometimes, the Rest Service takes a long time to reply. To prevent the user to click once before receiving the service answer, I would like to disable the button and change his value to 'loading...'
I want to do the same, only for all buttons whose value is equal to 'Search' or 'Relaunch'
Code :
<input type="submit" class="btn" ng-click="relaunch()" ng-value="Relaunch"/>
$scope.relaunch= function(){
RelaunchService.relaunch().then(function(data){
// server response
})
};
For this, I want to create one directive. But I do not know how to do it :-(
PS: Note that the user can click on several different buttons at the same time.
