mad*_*thi 6 javascript firefox json angularjs
我是angularjs的新手,我正在对角度控制器和模型进行简单的研究.这是我的javascript模型代码.
var testApp = angular.module('testApp', []);
testApp.controller('testCtrl', function testCtrl($scope ,$http) {
$http.get('test.json').success(function ($data){
$scope.artists = $data;
});
});
Run Code Online (Sandbox Code Playgroud)
网页已加载但是异常.我在Windows 7中使用firefox.
[例外......"访问受限制的URI被拒绝"代码:"1012"nsresult:"0x805303f4>.>(NS_ERROR_DOM_BAD_URI)"位置:"file:///....// angular.min.js行:72 "]
有没有人知道解决方案..我不需要在服务器上制作它只需要使用本地机器..
小智 1
您必须对角度控制器语法进行较小的更正。
testApp = angular.module('testApp', []);
testApp.controller('testCtrl', function($scope, $http) {
$http.get('test.json').success(function($data) {
$scope.artists = $data;
});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
558 次 |
| 最近记录: |