请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

cmd里运行gulp为什么浏览器里出现不了页面

Uncaught TypeError: $http.get(...).success is not a function

正在回答 回答被采纳积分+3

2回答

慕雪1613582 2018-05-04 16:53:44

在浏览器控制台里输入  angular.version,确认一下版本~

0 回复 有任何疑惑可以回复我~
慕雪1613582 2018-05-03 11:49:22

index.js代码运行出错了,你使用的AngularJS1.6版本,$http服务删除了success函数。两个解决方法:

  1. 换成和课程一样的AngularJS1.5版本

  2. $http.get(...).then(function( resp ) { $scope.xxx = resp.data })

0 回复 有任何疑惑可以回复我~
  • 提问者 慕圣6052956 #1
    怎么把之前装的angularjs卸了换课程里的那个啊
    回复 有任何疑惑可以回复我~ 2018-05-03 12:51:31
  • 提问者 慕圣6052956 #2
    用第二个方法就成这样了
    angular.min.js:125 ReferenceError: $scope is not defined(…) "Possibly unhandled rejection: {}"(anonymous function) @ angular.min.js:125
    angular.min.js:125 ReferenceError: $scope is not defined(…) "Possibly unhandled rejection: {}"(anonymous function) @ angular.min.js:125
    http://localhost:3000/favicon.ico Failed to load resource: the server responded with a status of 404 (Not Found)
    angular.min.js:125 ReferenceError: $scope is not defined(…) "Possibly unhandled rejection: {}"(anonymous function) @ angular.min.js:125
    angular.min.js:125 TypeError: $http.get(...).success is not a function(…) "<div ui-view="" class="ng-scope" data-ng-animate="1">"
    回复 有任何疑惑可以回复我~ 2018-05-03 13:03:56
  • 提问者 慕圣6052956 #3
    现在倒是又出现这个错了
    Uncaught TypeError: $http.get(...).success is not a function     index.js:375 
    livereload.js?snipver=1:351 LiveReload protocol error (invalid command 'reload', only valid commands are: hello)) after receiving data: "{"command":"reload","path":"C:\\web\\dist\\view\\search.html","liveCSS":true,"liveJs":true,"liveImg":true}"..
    http://localhost:3000/favicon.ico Failed to load resource: the server responded with a status of 404 (Not Found)
    回复 有任何疑惑可以回复我~ 2018-05-03 13:16:00
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信