templateUrl正在工作

时间:2015-08-28 14:35:59

标签: angularjs angularjs-directive

我有这个角度指令

myModule.directive('ctt', function() {
    return {
        restrict: 'E',
        templateUrl: 'hallo.html'
    };
});

但是templateUrl无效。当我使用模板时它工作正常。文件hallo.html也在正确的位置。 我能做些什么来工作?

1 个答案:

答案 0 :(得分:0)

如果您在Mozilla以外的任何浏览器中本地[不使用任何服务器]执行文件,您将收到跨域问题的错误。如果您在Mozilla中打开本地文件,则不会遇到任何问题。希望这可以帮到你。

相关问题