2016-12-02 66 views
1

我在上启动的$ionicLoading指令内控制ion-slides指令存在问题(它就像旅程)。我需要用两个按钮来更换滑块。

我不知道如何定义正确这里的范围:

$ionicLoading.show({ 
    templateUrl: 'js/_tour/intro.html', 
}); 

我想有定义的功能来控制$ionicSlideBoxDelegate

我想是这样的:

$ionicLoading.show({ 
    templateUrl: 'js/_tour/intro.html', 
     scope: { 
       something: function(){console.log(something);} 
       } 
    }); 

但它给了我这个错误:

ionic.bundle.js:21162 TypeError: scope.$new is not a function

回答

0

scope参数预计提供范围,而不是散列。

试试这个:

var scope = $rootScope.$new(); 
scope.something = function() { console.log("foo"); } 
+0

谢谢,可惜我还是有控制离子滑块问题,但现在范围工作。 – distante