Skip to content

Instantly share code, notes, and snippets.

@zmiftah
Forked from zergin/controller.js
Last active December 10, 2015 22:08
Show Gist options
  • Save zmiftah/4499449 to your computer and use it in GitHub Desktop.
Save zmiftah/4499449 to your computer and use it in GitHub Desktop.
JS: Angular Controller
$scope.$on('$viewContentLoaded', function() {
$scope._style = document.createElement('link');
$scope._style.type = 'text/css';
$scope._style.href = 'application/Invoice/Resource/single.css';
$scope._style.rel = 'stylesheet';
$scope._style = document.head.appendChild($scope._style);
});
$scope.$on('$destroy', function() {
$scope._style.parentNode.removeChild($scope._style);
delete $scope._style;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment