Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. $scope.TestFunc = function () {
  2.  
  3. alert("TestFunc called");
  4. }
  5.  
  6. <button class="btn btn-default btn-column" print-button-spinner test="TestFunc()" >
  7. test
  8. </button>
  9.  
  10. App.directive('printButtonSpinner', function() {
  11. return {
  12. scope:
  13. {
  14. docType: '@',
  15. test: '&'
  16. },
  17.  
  18. restrict: 'A',
  19.  
  20. link: function (scope, element) {
  21. var printFunc = scope.test();
  22. element.bind('click', printFunc);
  23. }
  24. };
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement