Closed Schubidu closed 8 years ago
Interesting change, I guess it works for this kind of module, where you actually want a module name (a string) as output from module.exports. 'Cause that's what angular wants in its module dependency array. Whereas most npm modules actually want to export the module (the code)
This modul is only useful with angular and angular always exports strings not a function, with this change you able to use in different ways: as dependency injection and as statement on directives templateUrl. Maybe in future you able to change the string directly in the module and save bits on output. Angular doesn't matter how the string looks like, if the string is unique.
@javoire will you merge this pull-request?
sorry for the delay :)
this addition makes so much sense, wonder why we didn't think about it before. Unless I'm missing something. Great job :+1:
With this change you don't have to know the full generated filename of the directive.html. Just add something like
var template = require('./template.html');
and you can use the template var to reference angular to the correct template.