Open trisys3 opened 9 years ago
Yeah, I guess this makes sense to have as an option
Hey, I actually started considering that this should be the default behaviour: #38
It is kind of achievable with the baseDir
option. Maybe you noticed that. But it could make sense to be default
I ran into the same problem and actually started using $templateCache manually with a plain html2js transpiler like so:
myApp.run(function($templateCache) { $templateCache.put('myview.html', require("./views/myview.html")); });
Also, I don't see the upside of creating a module for each template and then DI them in my main module (a lot of DI's ...). But if I'm missing something, please elaborate.
Hey, you can attach all templates to one module using the module
option: https://github.com/javoire/browserify-ng-html2js#b-with-gulp
Can we do folder name as part of the module name? As it is, this module is pretty much unusable for me, as we have instances of multiple HTML files with the same base name, no matter how much we try to avoid it. This will only increase as we make our app more complex, with multiple npm modules that may all fall under the same base Angular module.
There is probably a way we can avoid this issue, but wouldn't it be better to add the folder name as part of the module name in the first place? You can use things like the
path
module and__dirname
/__filename
variables included with Browserify (and we could use them in this transform), that's what they are there for. I don't think they take away too much performance, at least when your app is complex enough to consider using them, but if so I suppose this would be a reason to not implement this feature.