search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

1 answers
Q&A AngularJS路由添加controller问题
AngularJS路由添加controller问题
高洛峰 2016-11-12 13:44:30 Views 595

0

我在使用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显示在页面上,代码如下:

            
                
                
                
                
                
                
                
            


Your Answer
submit

1 answers
0

你的 $scope 单词写错了 , 自己找...

2016-11-12 13:44:46

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use