2016-07-05 15 views
0

私はこの角度コード

(function() { 
     'use strict'; 

     var sampleApp = angular.module('MyApp', [ 
      'ngRoute', 
      'MyApp.controllers.Main' 
     ]); 

     sampleApp .config(['$routeProvider', 
      function($routeProvider){ 
       $routeProvider. 

        when('/',{ 
         templateUrl: '../templates/home.html', 
         controller: 'homeController' 
        }). 

        when('/one',{ 
         templateUrl: '../templates/one.html', 
         controller: 'oneController' 
        }). 

        when('/two',{ 
         templateUrl: '../templates/two.html', 
         controller: 'twoController' 
        }). 
     }]); 

    })(); 

を持っていると私はjshintを使用するとき、私は、これらのエラーを取得します。

src/app/app.js: line 27, col 5, Expected an identifier and instead saw '}'. 
    src/app/app.js: line 27, col 5, Expected an assignment or function call and instead saw an expression. 
    src/app/app.js: line 27, col 6, Missing semicolon. 
    src/app/app.js: line 27, col 6, Expected an identifier and instead saw ']'. 
    src/app/app.js: line 27, col 6, Expected an assignment or function call and instead saw an expression. 
    src/app/app.js: line 27, col 7, Missing semicolon. 
    src/app/app.js: line 27, col 7, Expected an identifier and instead saw ')'. 
    src/app/app.js: line 27, col 7, Expected an assignment or function call and instead saw an expression. 
    src/app/app.js: line 29, col 2, Expected ']' to match '[' from line 9 and instead saw ')'. 
    src/app/app.js: line 29, col 5, Expected ')' and instead saw ';'. 
    src/app/app.js: line 29, col 6, Missing semicolon. 
    src/app/app.js: line 1, col 13, Unmatched '{'. 
    src/app/app.js: line 29, col 10, Unrecoverable syntax error. (100% scanned). 

私は最後

+0

のようになります。その代わりので、それは何の問題を実行しないであろうように... – SoluableNonagon

+0

9つの数字がそれを助けることは難しいように提供されていない、ちょうど良いようです – SoluableNonagon

答えて

2
when('/two',{ 
        templateUrl: '../templates/two.html', 
        controller: 'twoController' 
       }). 

をjshint渡すように角度を変更する方法を参照してください傾けます "" ";"それは一見

関連する問題