Angular pdf + Dialog
http://angularjs.org/
by Yonathan Benitah
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-messages.min.js"></script>
<script src="https://cdn.gitcdn.link/cdn/angular/bower-material/v1.1.0-rc.5-master-42833aa/angular-material.js"></script>
<link rel="stylesheet" href="https://cdn.gitcdn.link/cdn/angular/bower-material/v1.1.0-rc.5-master-42833aa/angular-material.css">
<script src="https://npmcdn.com/[email protected]/build/pdf.js"></script>
<script src="https://npmcdn.com/[email protected]/build/pdf.worker.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angularjs-pdf/2.0.0/angular-pdf.js"></script>
<div ng-app="myApp">
<div ng-controller="MyCtrl" layout="column">
<div my-tooltip="customersList">hover me</div>
</div>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
myApp.controller("MyCtrl", ["$scope", function($scope){
$scope.customersList = [
{
id:2,
name: 'custo 1'
},
{
id:3,
name: 'custo 5'
}
]
}]);
myApp.directive("myTooltip", [ function(){
return{
scope: {
customers:'=myTooltip'
},
link:function(scope, el){
var toDisplay = '';
for(var i = 0; i < scope.customers.length; i++){
toDisplay += scope.customers[i].name+'\n';
}
el.attr('title', toDisplay);
console.log(scope)
}
}
}]);