ericclemmons / grunt-angular-templates

Grunt build task to concatenate & pre-load your AngularJS templates
MIT License
710 stars 107 forks source link

prefix '/' #47

Closed matt-way closed 11 years ago

matt-way commented 11 years ago

Ok, I just spent a good 10 hours trying to find a bug with my templates. Turned out that my use of templates was like this: '/somewhere/file.html', and ngTemplates was generating 'somewhere/file.html' as the template key.

Now I'm not trying to argue what is the correct way of writing URI's or anything, but surely there is a way to stop someone else in the future arriving at the same problem?

ericclemmons commented 11 years ago

Easy fix! Just override url to be a callback & you can prepend the / to force an absolute URL.

https://github.com/ericclemmons/grunt-angular-templates#url https://github.com/ericclemmons/grunt-angular-templates/blob/master/Gruntfile.js#L177

ericclemmons commented 11 years ago

Perhaps there should be a "debugging" section in the README to help users understand that the generated URL has to match the templateUrl in the code exactly to work?

matt-way commented 11 years ago

Yeah, the url thing works fine. I do agree though that it has to be written somewhere, even just a notice to tell users to 'check' that the keys match. Thanks.