JS:
m1.directive('myTab', function(){
return {
restrict: 'E',
replace: true,
templateUrl: 'tab.html'
}
});
DOM
在angular里会 报下面的错,这是什么原因呢
angular.min.js:80 XMLHttpRequest cannot load file:///D:/%23zWorkFilehilin/demo/AngularJS/tab.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
很多浏览器基于安全策略不能直接通过js访问本地文件,把页面放在服务器上运行访问就可以了。
templateUrl: 'tab.html' 这个路径不对
怎么是跨域问题,换个浏览器有问题吗