Created
November 27, 2013 02:24
-
-
Save unkleara/7669751 to your computer and use it in GitHub Desktop.
dl common buttons
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
app.directive('editButton', [ function(){ | |
return { | |
restrict: 'EA', | |
replace : true, | |
scope : { | |
text : '@', | |
action : '&' | |
}, | |
template: '<button class="btn btn-xs btn-info" ng-click="action()"><i class="fa fa-edit"></i> {{text}}</button>' | |
}; | |
}]); | |
app.directive('deleteButton', [ function(){ | |
return { | |
restrict: 'EA', | |
replace : true, | |
scope : { | |
text : '@', | |
action : '&' | |
}, | |
template: '<button class="btn btn-xs btn-danger" ng-click="action()"><i class="fa fa-trash-o"></i> {{text}}</button>' | |
}; | |
}]); | |
app.directive('showError', [ function(){ | |
return { | |
restrict: 'EA', | |
replace : true, | |
scope : { | |
text : '@', | |
action : '&' | |
}, | |
template: '<small class="error" ng-show="action()">*{{text}}.</small>' | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment