用angular做移动客户端页面,route代码如下,
angular.module('swpApp.question', ['ionic']).config(['$stateProvider', function($stateProvider) {
$stateProvider
.state('questionList', {
url: '/questionList',
cache:'false',
resolve: {
loginInfo:["$q",appLogin.loginToken],//用户登录信息
spwItemListCacah:["$q",function($q){
return pageScroll.loadCacahData($q,"myQuestion");
}]//缓存信息
},
templateUrl: "app/question/view/questionList.html",
controller: 'QuestionListCtrl'
})
.state('questionDetail', {
url: '/questionDetail/:question_id',
cache:'false',
resolve: {
loginInfo:["$q",appLogin.loginToken]
},
templateUrl: "app/question/view/questionDetail.html",
controller: 'QuestionDetailCtrl'
})
}]);
在主页面跳往子页面时 报错:
Error: [ng:areq] Argument 'QuestionDetailCtrl' is not a function, got undefined
http://errors.angularjs.org/1.4.3/ng/areq?p0=QuestionDetailCtrl&p1=not%20a%20function%2C%20got%20undefined
at ionic.bundle.js:8900
at assertArg (ionic.bundle.js:10602)
at assertArgFn (ionic.bundle.js:10612)
at ionic.bundle.js:17807
at self.appendViewElement (ionic.bundle.js:52338)
at Object.switcher.render (ionic.bundle.js:50456)
at Object.switcher.init (ionic.bundle.js:50376)
at self.render (ionic.bundle.js:52198)
at self.register (ionic.bundle.js:52156)
at updateView (ionic.bundle.js:57577)
各位大侠 知道是为什么么,是我QuestionDetailCtrl定义有问题么,仿照QuestionListCtrl定义的啊,QuestionListCtrl就么有问题。我是 新手,在线急等,帮帮忙
c币不多 了 ,不好意思