Javascript 为什么我在这个控制器中得到“$http未定义”?

Javascript 为什么我在这个控制器中得到“$http未定义”?,javascript,html,angularjs,Javascript,Html,Angularjs,我正在构建一个AngularJS应用程序。我对Angular有点陌生,但我一直在学习教程之类的东西。我已经到了我想通过一个。所以,我把几个有棱角的文档和一个So帖子组合在一起: 这一个要,; 和+来构造控制器方法。 所以,最后我有这个: HTML 但是,Firefox在执行该代码时会记录此错误: Error: $http is not defined RegisterController/$scope.registerUser@http://l.tpb.com/js/controllers.js

我正在构建一个AngularJS应用程序。我对Angular有点陌生,但我一直在学习教程之类的东西。我已经到了我想通过一个。所以,我把几个有棱角的文档和一个So帖子组合在一起:

这一个要,; 和+来构造控制器方法。 所以,最后我有这个:

HTML 但是,Firefox在执行该代码时会记录此错误:

Error: $http is not defined
RegisterController/$scope.registerUser@http://l.tpb.com/js/controllers.js:22
_functionCall/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js:6541
ngEventDirectives[directiveName]</</</<@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js:13256
Scope.prototype.$eval@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js:8218
Scope.prototype.$apply@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js:8298
ngEventDirectives[directiveName]</</<@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js:13255
x.event.dispatch@http://l.tpb.com/js/jquery-1.10.2.min.js:5
x.event.add/v.handle@http://l.tpb.com/js/jquery-1.10.2.min.js:5
x.event.trigger@http://l.tpb.com/js/jquery-1.10.2.min.js:5
.trigger/<@http://l.tpb.com/js/jquery-1.10.2.min.js:5
.each@http://l.tpb.com/js/jquery-1.10.2.min.js:4
x.prototype.each@http://l.tpb.com/js/jquery-1.10.2.min.js:4
.trigger@http://l.tpb.com/js/jquery-1.10.2.min.js:5
x.fn[t]@http://l.tpb.com/js/jquery-1.10.2.min.js:6
onclick@http://l.tpb.com/#/register:1
你需要注射它

function RegisterController($scope, $http)
你需要注射它

function RegisterController($scope, $http)

我知道我是我的好朋友!非常感谢。我知道我是我的好朋友!非常感谢。
function RegisterController($scope, $http)