On Tuesday, 13 January 2015 19:53:59 UTC-8, Ben Clinkinbeard wrote:
>
> `require('angular-animate').directive("myDirective", ...);` should
>> register a new directive in the ngAnimate module.
>
>
> That code would not work as the module itself is not returned.
> `require('angular-animate')` will return the module name as a string:
> "ngAnimate". That would be the case for everything but angular itself.
>
Could it, perhaps, support both? I’ve never hacked on Angular, but would it
be very difficult to make the module dependency mechanism aware of this,
checking its arguments, and (a) if they’re strings, proceed as usual; (b)
if they’re modules, just grab the names?
(It would be extra nice if the same could be done for the DI mechanism,
e.g. `require('angular').service('foo', function(require('ngResource'),
…);`; but that looks like it might be a lot more involved.)
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.