2016-07-05 7 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). 

내가 jshint에게

+0

과 같아야 대신에, 그래서 그것은 아무 문제가 실행되지 것처럼 ... – SoluableNonagon

+0

구 개 번호가 도움이 힘든, 그래서 제공되지 않습니다, 잘 보인다 – SoluableNonagon

답변

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

마지막을 통과 각도를 변경하는 방법을 볼 수 없습니다 "." ";"이어야합니다. 처음 눈에

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