This is a seriously dumb question, but I always struggle with this so hopefully someone can help.
When creating my angular app I understand that in order to inject the correct provider, I first need to include it/require it when I define my module.
Here is an example - here I require the $routeProvider, so I include ngRoute:
var sampleApp = angular.module('phonecatApp', ['ngRoute']);
sampleApp.config(['$routeProvider',
function ($routeProvider) {
$locationProvider.html5Mode(true);
$routeProvider.
when('/about', {
templateUrl: 'home/about',
controller: 'AddOrderController'
}).
when('/contact', {
templateUrl: 'home/contact',
controller: 'ShowOrdersController'
}).
otherwise({
redirectTo: '/about'
});
}]);
Now I additionally require the $locationProvider but don't know what module to include, I look in all the angularjs docs and try ngLocation but no luck! My question (is not which module do I need for location) but rather how do I find out from the angular docs which module I need for any given provider?
I cant figure it out from the crazy documentation?
var sampleApp = angular.module('phonecatApp', ['ngRoute', '?????']);
sampleApp.config(['$routeProvider', '$locationProvider',
function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider.
when('/about', {
templateUrl: 'home/about',
controller: 'AddOrderController'
}).
when('/contact', {
templateUrl: 'home/contact',
controller: 'ShowOrdersController'
}).
otherwise({
redirectTo: '/about'
});
}]);