LaunchNavigator未在Scope。$ scope.getDirections中定义

时间:2016-03-05 11:51:23

标签: angularjs ionic-framework cordova-plugins

我尝试在我的应用中访问地图,但var launchNavigator功能无法运行。请一些助手。

app.controller(“YelpController”,函数($ scope,$ cordovaLaunchNavigator){

    $scope.getDirections = function(cafe){
        console.log("Getting directions for cafe");

        var launchNavigator = function() {
        //  console.log("Getting directions for raam");
        var destination=[
            cafe.location.coordinate.latitude,
            cafe.location.coordinate.longitude
        ];
            var source=[
                $scope.yelp.lat,
                $scope.yelp.lon
            ];

                launchNavigator.navigate(destination,source);

             };
};

1 个答案:

答案 0 :(得分:0)

我自己没试过,但尝试从launchNavigator.navigate(目的地,来源)更改你的电话; to $ cordovaLaunchNavigator.navigate(destination,source);