Unknown provider: $cordovaGeolocationProvider
<p>I am currently in the starting phase of building an app weather via Ionic. Right now i want to implement the cordova geolocation ,i have error <code>Unknown provider: $cordovaGeolocationProvider &lt;- $cordovaGeolocation</code> i try to fixed but unsuccessfully , However this keeps giving an error when opening it. For testing purposes i use ionic serve and check it in localhost.</p>

<p>my code </p>

<pre><code>(function() {
    angular.module('app.weather', ['ionic'])

        .factory('Weather', function($q, $http) {
            var deferred = $q.defer();

            function getCurrentWeather(lat, lng) {
                var url = 'https://api.forecast.io/forecast//' + lat + ',' + lng + '?callback=JSON_CALLBACK';
                $http.jsonp(url)
                    .success(deferred.resolve)
                    .error(deferred.reject);

                return deferred.promise;
            }

            return {
                getCurrentWeather: getCurrentWeather
            };
        })
        .controller('WeatherCtrl', function($scope, $cordovaGeolocation, Weather) {
            $scope.loading = true;

            $scope.toCelsius = function(temperature) {
                return ((temperature - 32) / 1.8).toFixed(1);
            };

            $cordovaGeolocation
                .getCurrentPosition({
                    timeout: 10000,
                    enableHighAccuracy: false
                })
                .then(function(position) {
                    var lat = position.coords.latitude;
                    var long = position.coords.longitude;

                    Weather.getCurrentWeather(lat, long).then(function(data) {
                        $scope.weatherInfo = data;
                        $scope.loading = false;
                    }, function(error) {
                        //TODO Display error message
                    });
                }, function(err) {
                    //TODO Display error message
                });
        });
})();
</code></pre>

<p>code html </p>

<pre><code>&lt;ion-view title="الرئيسية" id="page2" style="background-color:#FFFFFF;" class=" "&gt;
    &lt;ion-content padding="true" class="has-header"&gt;
    &lt;ion-pane&gt;
&lt;div ng-controller="WeatherCtrl as weatherCtrl"&gt;
 &lt;div ng-show="loading"&gt;
                Carregando informações...
            &lt;/div&gt;
            &lt;div ng-hide="loading"&gt;
                &lt;p&gt;
                    Temperatura: {{toCelsius(weatherInfo.currently.temperature)}}º
                &lt;/p&gt;
                &lt;p&gt;
                    Sensação térmica: {{toCelsius(weatherInfo.currently.apparentTemperature)}}º
                &lt;/p&gt;
            &lt;/div&gt;
                        &lt;/div&gt;

    &lt;/ion-content&gt;
&lt;/ion-view&gt;
</code></pre>