angularjs - in angular why does adding an ng-disabled to an ng-click button make it fire twice in a row -
I have an ionic angle app that has ng-click twice in a row I set a fire on a ng-disabled property (I wanted to stop them from clicking on the button twice).
Why is this ng-disabled property?
& lt; Button ng-if = "post._id" class = "button button-block button-outline" ng-click = "create post ()" ng-disabled = "isaving"> Update & lt; / Button & gt;
I have not found an answer to your problem, but I have another solution for you The problem, here's a
I created a directory called networkInfo that sets the button content according to whether the network call is being made or not.
It is not in the right way, but 7 lines have a link function, and a button with two attributes is not half bad.
The attribute makingcol is the call that the call is being made. The NetworkInfo attribute link sends the function binding to the call within its scope.
Function To copy asynchronous network calls (using $ http or something else)
Firstly Vm.working , if this is true Then do not call another network then it sets it to true , to issue instructions that a call is now in process.
Finally set it to false $ timeout 2secs to signal at the end of the network call vm.working Will do
Obviously I have used Boost because this is what I am more familiar with, however, its familiar costumes.
Comments
Post a Comment