You can't use the url as "/_directive/test.tpl.html" + version
, becuse that will compile to /_directive/test.tpl.html0.0.1
and this html
is not found, so we should change it to "/_directive/test.tpl.html?" + version
or "/_directive/test.tpl.html?version=" + version
to have better result:
/_directive/test.tpl.html?0.0.1
/_directive/test.tpl.html?version=0.0.1
for sending public params in all the project we have to set theme before define angular app, see the example
window.version = "0.0.1";
var app = angular.module("app", ["ngRoute"]);
app.component('test', {
templateUrl: 'partials/home-template.html?' + window.version,
controller: function() {
console.log(window.version)
}
});
check your Network tab in the chrome or firefox to see the compile mode.