Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

christurnbull
Copy link

Added functionality:

DEMO: http://plnkr.co/edit/WRaLC2?p=preview

  • 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

 *  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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@DocX
Copy link
Owner

DocX commented Feb 14, 2016

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants