在带有 url 的视频观看页面上
/watch/video_id
,我有一个 ng 应用程序。该指令如下所示。
app.directive('myApp', function() {
    return {
      restrict: 'E',
      templateUrl: 'ng-templates/myTemplate.html', 
      link: function(scope, elem, attrs) {
      },
      controller: 'Controller'
    };
  }); 
由于 templateUrl 是相对路径,它会尝试在
'/watch/ng-templates/myTemplate.html'
这是一个错误。
我想将所有模板放在 ng-templates 文件夹中。但是如果 ng 应用程序总是寻找相对路径,它就不起作用了。有没有办法配置应用程序使其查找“/ng-template/myTemplate.html”?