Closed SamanthaAdrichem closed 5 years ago
Hi, I struggled quite a bit with this loader (but I'm also new to webpack, so a lot of my struggles were just webpack related).
Did you try something like this?
'ngtemplate-loader?relativeTo=' + (path.resolve(__dirname, './app')) + '/'
I just had a similar problem, and adding the trailing / to the relativeTo option fixed it.
Will try that tomorrow! Thnx
you lifesaver @pjparra
Glad this solution works for you too :smile:
I never closed this. So sorry. It worked for us too! Thnx again!
@pjparra saved my day, thanks!
We've been using angular for quite a while now, and have always included templates from the app/root director like this
file is at app/pages/page/template.html templateUrl: 'pages/page/template.html'
your plugin however adds a / infront of it.
Now with the default require, that is not an issue, because we use it like var templateUrl = require("pages/page/template.html") templateUrl: templateUrl.
However in case of ng-include we do require("path/file.html"); ng-include src="'path/file.html'" (does not support an angular variable...
and then it says template not found, for the template suddenly has been registered with a prefixed /
the template loader is included as:
'ngtemplate-loader?relativeTo=' + (path.resolve(__dirname, './app')),
how do we remove this prefixed /??