我在使用angularjs路由中,想要将在路由创建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 = "作业"; $scoep.Lists = [ { 'id':'1', 'name':'作业1', 'info':'这是作业1的描述啦' }, { 'id':'2', 'name':'作业2', 'info':'这是作业2的描述啦' }, { 'id':'2', 'name':'作业2', 'info':'这是作业2的描述啦' } ]; } });
我在页面上想获取这里的op_object和Lists显示在页面上,代码如下:
<tr ng-repeat="list in Lists"> <td><input type="checkbox"></td> <td ng-bind="list.id"></td> <td ng-bind="list.name"></td> <td ng-bind="list.info"></td> <td><i class="icon-pencil yellow_icon"></i></td> <td><i class="icon-gear blue_icon"></i></td> <td><i class="icon-remove red_icon"></i></td> </tr>
你的 $scope 单词写错了 , 自己找...