Closed santo74 closed 8 years ago
Hi! It's not a bug. It means that you create the custom module outside loader. But for convenience I will add this code.
Thanks, that would be awesome!
I'm not sure I understand your explanation though. What do you mean by "you create the custom module outside the loader"? I'm not creating any custom module myself. I just have a simple angular app with some external templates which I want to bundle with webpack, using ng-cache-loader for putting the templates in the angular cache. To ng-cache-loader I'm telling that it should use a custom module name for my templates, so I would expect that ng-cache-loader also creates that custom module for me (cfr browserify).
Again, I'm new to webpack, so I might overlook something obvious.
Thanks
Now the specified module will be created. Then you can point it in the dependency:
require('ng-cache?module=myTemplates!./tpls/pagination.html');
angular.module('todoApp', ['myTemplates'])
I just updated to ng-cache-loader v0.0.14 and now it works indeed. Thanks!
Hi,
When I specify a custom module name like this:
I get the following error when I load the application in the browser: "Uncaught Error: [$injector:nomod] Module '["myTemplates"]' is not available! When I omit the custom module parameter, everything works fine.
I'm new to Webpack, so I might be missing something obvious, but looking at the generated code, there seems to be missing some code to create the custom module.
This is the generated code, which results in the above error:
If I add one extra line, it works fine:
Browserify, for example, does something similar. It generates the following code for each template:
Is this a bug?