我建立一个应用程序来动态地从数据库中AngularJS加载和显示数据,但是当我尝试访问我的API(使用$ HTTP()或$ http.get()),我收到errrors.$ http.get()错误:TypeError: undefined is not a function,$ http()错误:TypeError: object is not a function
代码中出现此特定错误,以动态加载导航选项卡.
CoffeeScript中的代码:
p4pControllers.controller 'navCtrl', [
'$routeParams'
'$scope'
'$http'
($http,$scope,$routeParams) ->
$http(
method:'GET'
url:'http://p4p-api.snyx.nl/tables'
).success (data) ->
$scope.tabs = data
return
return
$http.get('http://p4p-api.snyx.nl/tables').success (data) ->
$scope.tabs = data
return
return
]
Run Code Online (Sandbox Code Playgroud)
有谁看到我在这里做错了什么?