2017-02-23 3 views
0

内部から別のモジュールへのルートのOracleダッシュボードは私の問題を説明するために生成されるデフォルトのヨーマンのデフォルトの一部使用する:オラクルジェット - どのようにモジュール

../src/index.html 
../src/js/appController.js 
../src/js/main.js 
../src/js/views/dashboard.html 
../src/js/views/customers.html 
../src/js/viewModels/dashboard.js 
../src/js/viewModels/customers.js 

を私はダッシュボードモジュールでだと私はしたい場合〜のようなものに

function DashboardViewModel() { 
... 
self.currentRowListener = function (event, ui) { 
Router.rootInstance.go('customers'); 
} 
... 

どうすればいいですか?特定のモジュールから別のモジュールにリダイレクトする方法を見つけることができません

答えて

1

Router.go機能は正しい方法です。oj.Router.rootInstanceを使用するだけです。ルータを正しく設定しておけば、デフォルトのテンプレートを使用していると思われます。これはすべてでなければなりません。

例:それは完璧に動作

define(['ojs/ojcore', 'ojs/ojrouter'], function (oj) { 
    function DashboardViewModel() { 
     var self = this; 
     self.currentRowListener = function (event, ui) { 
      oj.Router.rootInstance.go('customers'); 
     } 
    } 
    return DashboardViewModel; 
}); 
+0

非常に素晴らしい..私はちょうど定義宣言でOJS /ルータを追加するのを忘れ – Dom

関連する問題