Closed brandon-arnold closed 9 years ago
I think I have resolved it. It is a discrepancy between generator-angular-fullstack and grunt-angular-templates. In generator-angular-fullstack, the boilerplate codefiles for a directive have the templateUrl's with a preceding '/'. But grunt-angular-templates is generating URLs in the $templateCache .put(...) statements without the preceding '/'. This difference results in the directive making an HTTP get, resulting in a 404.
I think angular's template engine should support the different URLs, personally. Is there a right way to do this?
I'd use a prefix
:
https://github.com/ericclemmons/grunt-angular-templates#prefix
Let me know if that works!
Good to know. I see that the generator does it both ways! So the generator needs to be consistent. I will bring this information in the referenced article and do a pull request on theirs. Thanks a bunch!
And yes, a 'prefix' works.
Hi there,
I've had this issue on the angular-fullstack github for a few weeks now to no avail, and I'm really not sure how to fix it. Any help would be greatly appreciated. I generated the application using their generator, but from what I can see, they've got ngTemplates configured right, and it does seem to work out of the box on the boilerplate application.
Anyway, for some reason my 'dist' application is trying to get angular partials from the server (resulting in 404's for each; see
grunt serve:dist
output below, in which the root Angular directive of my application has a 404, since it is correctly not copied to my dist output, expecting it instead to be stored in $templateCache). And I can see that the ngtemplates task must be working to some extent, since the partials are in mydist/public/app/...app.js
(e.g. there is a line in the minified JS of the forma.put("app/components/pcyBody/pcyBody.html", '<!-- Output HTML -->') }]);
).Environment information (aside from grunt-angular-templates version 0.5.7):
Relevant Gruntfile.js sections
Output of
grunt serve:dist