ionic-team / ng-cordova

OBSOLETE: Please move to Ionic Native https://github.com/ionic-team/ionic-native
https://github.com/ionic-team/ionic-native
MIT License
3.48k stars 1.05k forks source link

referenceerror: launchnavigator is not defined #1373

Open madhurigr opened 7 years ago

madhurigr commented 7 years ago

I am using ionic 2.1.4 and cordova 5.0.0. I am testing my app on android 5.1.

When I call navigate() method using $cordovaLaunchNavigator, it throws an error that is "referenceerror: launchnavigator is not defined" When I was debugging, I have found this error in below code (https://github.com/driftyco/ng-cordova/blob/master/src/plugins/launchNavigator.js#L12):

angular.module('ngCordova.plugins.launchNavigator', [])
  .factory('$cordovaLaunchNavigator', ['$q', function ($q) {

    return {
      navigate: function (destination, start, options) {
        var q = $q.defer();
        launchnavigator.navigate(
          destination,
          start,
          function (){
            q.resolve();
          },
          function (error){
            q.reject(error);
          },
          options);
        return q.promise;
      }
    };

  }]);

Could you please suggest me any idea to fix it.

vitaliy-bobrov commented 7 years ago

@madhurigr, Are you tried to use it on real device and call for it inside $ionicPlatform.ready?