Open
Conversation
* handle ngResource promise and null/empty promises * attribute to submit form - if a promise is supplied the button turns into type="submit" * attributes for button success/error class - defaults to btn-success/btn-danger * attribute to revert to original class after revert period * classes for span elements & use fa-spin class * added dependency injection annotations
Added fix for bug in some browsers when submitting form
| */ | ||
| angular.module('ngPromiseButton', []) | ||
| .directive('promiseButton', function ($compile, $timeout) { | ||
| .directive('promiseButton', ['$compile', '$timeout' , function ($compile, $timeout) { |
Owner
There was a problem hiding this comment.
I don't like messing the code with build related overhead like this. This can be done build-time using for example https://github.com/olov/ng-annotate
Owner
|
Thanks christurnbull, I'm glad you found it useful. Your changes looks great. Check the comments above and we can move it. Also please remove the modification of README file from PR - I obviously cannot merge to upstream saying "This is a fork". I will add you to contributors section and update the demo link after pull. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added functionality:
DEMO: http://plnkr.co/edit/WRaLC2?p=preview