apollo_developers/bower_components/angular-save-html-to-pdf/src/htmlToPdfSave.buttonDirective.js
venbatechnologies@gmail.com 1809bcf9c9 fixed table for student details
2018-04-23 18:34:11 +05:30

24 lines
556 B
JavaScript
Executable File

angular.module('htmlToPdfSave')
.directive('pdfSaveButton' , ['$rootScope' , '$pdfStorage' , function($rootScope , $pdfStorage) {
return {
restrict: 'A',
link : function(scope , element , attrs ) {
$pdfStorage.pdfSaveButtons.push(element) ;
scope.buttonText = "Button";
element.on('click' , function() {
var activePdfSaveId = attrs.pdfSaveButton ;
var activePdfSaveName = attrs.pdfName;
$rootScope.$broadcast('savePdfEvent' , {activePdfSaveId : activePdfSaveId, activePdfSaveName: activePdfSaveName}) ;
})
}
}
}]) ;