Probably you haven’t injected $http
service to your controller. There are several ways of doing that.
Please read this reference about DI. Then it gets very simple:
function MyController($scope, $http) {
// ... your code
}
More Related Contents:
- AngularJs $http.post() does not send data
- How to cancel an $http request in AngularJS?
- How to POST binary files with AngularJS (with upload DEMO)
- How to use $http promise response outside success handler
- Error: 10 $digest() iterations reached. Aborting! with dynamic sortby predicate
- Angular JS break ForEach
- Angularjs autocomplete from $http
- Is it feasible for a start-up of two developers to do full automated regression testing without manual testing? [closed]
- If you are not using a .(dot) in your AngularJS models you are doing it wrong?
- AngularJS For Loop with Numbers & Ranges
- AngularJS-Twig conflict with double curly braces
- AngularJS – Create a directive that uses ng-model
- AngularJS ng-class if-else expression
- Cordova + Angularjs + Device Ready
- No ‘Access-Control-Allow-Origin’ header is present on the requested resource- AngularJS
- Chaining Ajax calls in AngularJs
- Why angularjs will invoke function `name()` twice?
- AngularJS : ng-repeat filter when value is greater than
- AngularJs Remove duplicate elements in ng-repeat
- Angularjs how to cancel resource promise when switching routes
- How would I have ui-router go to an external link, such as google.com?
- How to highlight a current menu item?
- AngularJS All slashes in URL changed to %2F
- Error : getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
- Lazy loading AngularJS modules with RequireJS
- ng-options with simple array init
- stop angular-ui-router navigation until promise is resolved
- Fontawesome is not working when project is built with grunt
- Good way to dynamically open / close a popover (or tooltip) using angular, based on expression?
- scope and controller instantiation with ui router