Last active
August 29, 2020 08:13
-
-
Save elpddev/5d57d06b3867ed46877ca61cd434d755 to your computer and use it in GitHub Desktop.
AngularJs require directive #angularjs #medium #article-hierarchical-di-ng
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moviesApp.directive('printout', ['$sce', function printout($sce) { | |
return { | |
restrict: 'A', | |
require: { | |
ngModel: '' | |
}, | |
link: (scope, element, attrs, requireCtrls) { | |
requireCtrls.ngModel.$render = function() { | |
element.html($sce.getTrustedHtml(requireCtrls.ngModel.$viewValue || '')); | |
}; | |
} | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment