OnsenUI V1で複数コントローラを使用して画面ごとの処理を分けて処理を書いて動作していたのですが、OnsenUI V2に移行しようとしているのですが、最初のindex.html用のindexCtrl.jsは反応するのですが、そのほかの画面でng-controllerで指定したコントローラが全く反応しないのは仕様ですか?V1のコードから別途新規に追加しなければならない処理があったりしますでしょうか?現時点で今まで動作していた各コントローラのinit()がコールされなくなっていますorz
html
1(first.html) 2<ons-page> 3<div ng-controller="index.html"> 4(省略) 5<ons-button onclick="next()">NEXT</ons-button> 6</div> 7</ons-page> 8 9(login.html) 10<ons-page> 11<div ng-controller="login.html"> 12(省略) 13</div> 14</ons-page> 15
javascript
1 2require('../app').controller('IndexCtrl', ['$scope', 3function ($scope) { 4 $scope.next = function(){ 5 myNavigator.replacePage('login.html'); 6 } 7 var init = function(){ 8 } 9 init(); 10} 11 12require('../app').controller('LoginCtrl', ['$scope', 13function ($scope) { 14 var init = function(){ 15 } 16 init(); 17} 18 19
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/01/24 05:57