私のアプリのある状態から別の状態に移行しようとするとエラーが発生します。状態anglejsを解決できません
インデックスファイルに私の状態がすべて定義されています。
index.js
var MyModule = angular.module('myApp.ui.moduleTest', [
'ui.router'
])
.config(function($stateProvider, modalStateProvider){
$stateProvider
.state('myApp.dashboard.appArea.moduleTest',
modalStateProvider.create({
animation: true,
name: 'myApp.dashboard.appArea.moduleTest',
url: 'apps/moduleTest',
controllerAs: 'moduleTestCtrl',
controller: 'ModuleTestCtrl',
windowClass: 'semi-modal semi-modal--huge',
templateUrl: function() {
return 'app/ui/apps/moduleTest/widget.html';
},
resolve: {
//Some function to retrieve data
}
})
)
.state('myApp.dashboard.appArea.moduleTest.wizards',
modalStateProvider.create({
animation: true,
name: 'myApp.dashboard.appArea.moduleTest.wizards',
url: 'apps/moduleTest/runWizard',
controllerAs: 'moduleTestWizardCtrl',
controller: 'ModuleTestWizardCtrl',
templateUrl: function(){
return 'app/ui/apps/moduleTest/wizard.html';
}
// resolve: {
//
// }
})
)
})
私は状態「myApp.dashboard.appArea.moduleTest.wizardsに行くことにしようとしている "myApp.dashboard.appArea.moduleTest" フロンModuleTestCtrl状態によ
"しかし、"状態を解決できませんでした "というエラーが表示されます。どのように私はその状態に移動するために私のコントローラの内部にこの設定モジュールをインポートできますか?/*jslint node: true */
'use strict';
var angular = require('angular');
function ModuleTestCtrl($uibModalInstance, Api, diagnosticsRaw, myService, $state) {
this.$uibModalInstance = $uibModalInstance;
this.Api = Api;
this.dataRaw = diagnosticsRaw;
this.parserData = function(indexes) {
//Some app logic irrelevant
}
myService.setPropertyToRun(this.dataRaw);
myService.setIsPropertyToRun(true);
$state.go('myApp.dashboard.appArea.moduleTest.wizards'); //THIS IS WHERE I HAVE MY PROBLEM
};
}
ModuleTestCtrl $ [[API '、 'diagnosticsRaw'、 'myServiceという'、 '$状態'、 '$ uibModalInstance'] =注入します。 module.exports = ModuleTestCtrl;
感謝を。私はすべての親ルートが別のフォルダとファイルで私のアプリで定義されている。たぶん私は必要な注射や注射を逃したでしょうか?私はそのように見ようとしています – acostela
最後に私はそれを解決しました。すべての親ルートが定義されましたが、親ステートの1つが私の内部スクリプトに間違ってインポートされました。その結果、ネスト状態は作成されませんでした。この答えは正しかったので、私はそれを解決済みとしてマークします。ありがとうございました! – acostela