Skip to content

Instantly share code, notes, and snippets.

@GulinSS
Last active August 29, 2015 14:09
Show Gist options
  • Save GulinSS/c506d706a6fd2e0d08da to your computer and use it in GitHub Desktop.
Save GulinSS/c506d706a6fd2e0d08da to your computer and use it in GitHub Desktop.
angular.module('...').directive('...', [
function() {
return {
scope: {
service: '@'
},
link: function (scope, elm, attrs) {
scope.serviceInjected = elm.injector().get(scope.service);
}
}
}
]);
@andreychev
Copy link

А почему не стали использовать $injector.get('service')?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment