I am currently working on an app that is designed to load and display data dynamically from a database using AngularJS. However, I have been encountering errors when trying to access my API using both $http() and $http.get(). The specific errors I am receiving are as follows: $http.get() error:
TypeError: undefined is not a function
, $http() error: TypeError: object is not a function
These errors seem to be happening within the code that is responsible for dynamically loading navigation tabs.
The CoffeeScript code for this functionality looks like this:
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
]
Can anyone spot what might be causing these errors in my code?