I am creating an application to dynamically load and display data from a database in AngularJS, but when I try to access my API (using either $ http () or $ http.get ()), I get errors. Error $ http.get (): TypeError: undefined is not a function , error $ http (): TypeError: object is not a function
This error occurs in the code for dynamically loading navigation tabs.
Code for both in 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 ]
Does anyone see what I'm doing wrong here?
javascript angularjs coffeescript
RogerCapiche
source share