2016-12-02 67 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