Take the following example directive:
.directive("myDirective", function() {
return {
restrict: "A",
templateUrl: "/my/absolute/path.tmplt.html",
controller: ...Do Controller Stuff...
}
});
This runs through the Closure Compiler without error. However, when loading the app I am greeted with a 404 as it tries to load the full /my/absolute/path.tmplt.html path. Removing the leading '/' resolves the problem. This is also a problem for
ng-include(src="'/my/url'"), ng-controller="myCtrl") located in the HTML files and I suspect anywhere you could reference a url.
So why do absolute paths fail while relative ones work just fine?