我是angularjs.can的新手,有人幫助我解決這個問題。
代碼
var myApp = angular.module("myApp", ['ngRoute','ngAnimate']);
myApp.controller('angCon2', function($scope, $http) {
$http.get('https://api.myjson.com/bins/nlfmz')
.success(function(response) {
$scope.lists = response;
});
});
錯誤消息
TypeError: $http.get(...).success is not a function
是什麼讓你覺得'.success'是一個東西......? →https://docs.angularjs.org/api/ng/service/$http – deceze
使用'then'而不是'success',看到這個:http://stackoverflow.com/questions/33531336/angularjs-error-success不是一個功能 –