$http.get(...).success is not a function 錯誤解決
1.6 新版本的AngularJs中用then和catch 代替了success和error,用PRomise規則。
更改寫法:
$http.get('/api/user/showname2', {
//內容
}).then(function (result) {//正確請求成功時處理
alert(result.data);
//正確內容
}).catch(function (result) { //捕捉錯誤處理
//錯誤內容
});
