私はイオンプロジェクトに取り組んでいます。私は次のアプリ構造を持っています...
app
|__dashboard
|__dashboard.html
|__dashboard.module.js
|__controller.js
|__app.js
|__config.js
index.html
controller.js 内で定義されたコントローラーがあります。あれは:
angular.module('dashboard').controller('Ctrl', function(){
console.log('hello');
});
そして、app.jsにルートがあります。あれは:
.
.
.
$stateProvider
.state('app', {
url: 'app/',
abstract: true
})
.state('app.home', {
url: '/home',
views: {
'menuContent': {
templateUrl: 'app/dashboard/dashboard.html',
controller: 'Ctrl'
}
}
});
私の index.html では、すべてのファイルを呼び出します。
ただし、アプリを実行すると、次のエラーが発生します。
Error: [ng:areq] Argument 'Ctrl' is not a function, got undefined
誰かが私を助けてくれますか?ありがとう!!!