Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.TestFunc = function () {
- alert("TestFunc called");
- }
- <button class="btn btn-default btn-column" print-button-spinner test="TestFunc()" >
- test
- </button>
- App.directive('printButtonSpinner', function() {
- return {
- scope:
- {
- docType: '@',
- test: '&'
- },
- restrict: 'A',
- link: function (scope, element) {
- var printFunc = scope.test();
- element.bind('click', printFunc);
- }
- };
- });
- TypeError: eventFns[i] is undefined
- eventFns[i].call(element, event);
- var printFn = function (docType, element) {/*some code*/}
- <button class="btn btn-default btn-column" print-button-spinner doc-type="zebraCurLabels" print="printFn(docType, null)">
- </button>
- App.directive('printButtonSpinner', function() {
- return {
- scope:
- {
- docType: '@',
- print: '&'
- },
- restrict: 'A',
- link: function (scope, element) {
- var print = scope.test;
- element.bind('click', print(scope.docType, element));
- }
- };
- });
- TypeError: eventFns[i] is undefined
- eventFns[i].call(element, event);
- element.bind('click', function(){
- print(scope.docType, element);
- });
Add Comment
Please, Sign In to add comment