我在使用angularjs路由中,想要將在路由創(chuàng)建controller,然后為頁面賦值,但是報錯說 ReferenceError: $scoep is not defined,但我不知道哪里出問題了,還請幫我只小白分析分析。我的代碼如下:userApp.config(function($routeProvider){$routeProvider.when('/',{templateUrl:'views/userViews/homeUserView.html'}).when('/app',{templateUrl:'views/userViews/application.html'}).when('/work',{ templateUrl:'views/userViews/work.html', controller:'jobCtrl' controller:function($scope){ $scope.op_object = "作業(yè)"; $scoep.Lists = [ { 'id':'1', 'name':'作業(yè)1', 'info':'這是作業(yè)1的描述啦' }, { 'id':'2', 'name':'作業(yè)2', 'info':'這是作業(yè)2的描述啦' }, { 'id':'2', 'name':'作業(yè)2', 'info':'這是作業(yè)2的描述啦' } ]; }});我在頁面上想獲取這里的op_object和Lists顯示在頁面上,代碼如下:
AngularJS路由添加controller問題
牛魔王的故事
2018-09-08 09:41:34
