92
rated 0 times
[
98]
[
6]
/ answers: 1 / hits: 23414
/ 11 Years ago, wed, july 17, 2013, 12:00:00
On the video watch page with the url
/watch/video_id
, I had a ng app. The directive is shown as below.
app.directive('myApp', function() {
return {
restrict: 'E',
templateUrl: 'ng-templates/myTemplate.html',
link: function(scope, elem, attrs) {
},
controller: 'Controller'
};
});
Since the templateUrl is the relative path, it will try to find the template in
'/watch/ng-templates/myTemplate.html'
which is an error.
I want to put all the templates in the ng-templates folder. But it won't work if the ng app always looks for the relative path. Is there a way to configure the app making it to look for '/ng-template/myTemplate.html'?
More From » angularjs