I have some troubles whith print function in AngularJS. I have a button wich call au print function in my controller. But I have just that error :
TypeError: $window.print is not a function
HTML :
<md-button class="md-raised" ng-click="printThis()">Imprimer</md-button>
JS :
$scope.printThis = function(){
console.info("Let go print !");
alert("PLOP");
window.alert("FOO");
$window.alert("BAR");
$window.print();
};
When I click on button, I have 3 alerts then the TypeError ! I tried both window.print() and $window.print() but nothing works... I really don't understand ! If i press ctrl + P, the chrome popup to print appears normally...
Need help please