Skip to content

Instantly share code, notes, and snippets.

@davidsonfellipe
Created August 6, 2015 18:40
Show Gist options
  • Save davidsonfellipe/3b71ab229df6cc3b12fd to your computer and use it in GitHub Desktop.
Save davidsonfellipe/3b71ab229df6cc3b12fd to your computer and use it in GitHub Desktop.
(function() {
"use strict";
function Icon($sce) {
function Link(scope, elem, attrs) {
scope.getIcon = function(name) {
return $sce.trustAsResourceUrl('/assets/svg/icons/icon_' + name + '.svg');
};
}
return {
"templateUrl": "assets/components/icon/ls-icon.html",
restrict: "E",
link: Link,
replace: false,
scope: {
'name': '@'
}
};
}
Icon.$inject = ["$sce"];
angular.module("MYAPP")
.directive("uiIcon", Icon);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment