diff options
| author | pliablepixels <pliablepixels@gmail.com> | 2016-04-30 14:44:13 -0400 |
|---|---|---|
| committer | pliablepixels <pliablepixels@gmail.com> | 2016-04-30 14:44:13 -0400 |
| commit | c59f45bf14e7915feca4e0303e204e33ef83998e (patch) | |
| tree | 584774329ea9b7f5480ffb0b37ef24bd3a42614b /www/lib/angular-wizard/src/wizardButtons.js | |
| parent | 64efb670cd148b017c863da0880bd624c29ccef5 (diff) | |
#234 - initial code - template
Former-commit-id: 57b199dac407d8a19ca13df5f54ca829d40bb7e6
Diffstat (limited to 'www/lib/angular-wizard/src/wizardButtons.js')
| -rw-r--r-- | www/lib/angular-wizard/src/wizardButtons.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/www/lib/angular-wizard/src/wizardButtons.js b/www/lib/angular-wizard/src/wizardButtons.js new file mode 100644 index 00000000..0afb46f8 --- /dev/null +++ b/www/lib/angular-wizard/src/wizardButtons.js @@ -0,0 +1,26 @@ +function wizardButtonDirective(action) { + angular.module('mgo-angular-wizard') + .directive(action, function() { + return { + restrict: 'A', + replace: false, + require: '^wizard', + link: function($scope, $element, $attrs, wizard) { + + $element.on("click", function(e) { + e.preventDefault(); + $scope.$apply(function() { + $scope.$eval($attrs[action]); + wizard[action.replace("wz", "").toLowerCase()](); + }); + }); + } + }; + }); +} + +wizardButtonDirective('wzNext'); +wizardButtonDirective('wzPrevious'); +wizardButtonDirective('wzFinish'); +wizardButtonDirective('wzCancel'); +wizardButtonDirective('wzReset'); |
