Decorate Service in Directive based on Attributes in AngularJS
问题 Disclosure: I'm new to angular, so if I'm doing something that appears strange or just plain wrong, feel free to point that out. I have a directive vpMap that I want to use like this: <div my-map with-tile-layers with-geolocator></div> I have a Map service that I want to decorate conditionally, based on the attributes of the directive that begin with with It looks something like this: angular.module('myApp.map',[]) .service('Map',someServiceFunction) .directive('myMap',['Map','$provide'