The console reported an error and the data was not printed on the console page
1234567891011 |
Error: [$http:baddata] http:
//errors.angularjs.org/1.6.4/$http/baddata?p0=%5B%7B%0D%0A%09%22id%22%…C%0D%0A%09%22like%22%20%20%20%20%3A%2298.93%25%22%0D%0A%7D%5D%3B&p1=%7B%7D
at angular.min.js:6
at nc (angular.min.js:96)
at angular.min.js:97
at q (angular.min.js:7)
at xd (angular.min.js:97)
at f (angular.min.js:99)
at angular.min.js:134
at m.$digest (angular.min.js:145)
at m.$apply (angular.min.js:149)
at l (angular.min.js:102)
"Possibly unhandled rejection: {}"
|
My Code, mainctrl.js.
12345 |
angular.module( ‘app‘ ).controller( ‘mainCtrl‘ ,[ ‘$http‘ , ‘$scope‘ , function ($http,$scope) { $http.get( ‘/data/list.json‘ ).then( function (resp){ $scope.list= resp.data; }); }]); |
JSON data
12345678910 |
[{
"id"
:
"1"
,
"imgSrc"
:
"/image/list_1.jpg"
,
"name"
:
"黑眼豆豆"
,
"oldPrice"
:
"¥22.00"
,
"newPrice"
:
"¥9.00"
,
"desc"
:
"王祖蓝吃了说“完美”"
,
"quantity"
:
"438975"
,
"like"
:
"98.93%"
}];
|
Unable to read JSON data Error: [$http: Baddata]