2014-12-11 4 views
0

나는 다음과 같은 오류가있어 내 ember-cli 프로젝트 I ember server 때마다 :엠버-CLI : 예상 할당 또는 함수 호출

router.js: line 12, col 45, Expected an assignment or function call and instead saw an expression 
router.js: line 16, col 48, Expected an assignment or function call and instead saw an expression 
router.js: line 20, col 41, Expected an assignment or function call and instead saw an expression 
router.js: line 23, col 25, Expected an assignment or function call and instead saw an expression 

내가 이상 사라 내 router.js 파일을 통해 실행할 수없는 것 이 문제를 찾을 수가 :

import Ember from 'ember'; 
import config from './config/environment'; 

var Router = Ember.Router.extend({ 
    location: config.locationType 
}); 

Router.map(function() { 
    this.resource('dashboard',{path:'/'}), 
    this.resource('items',{path:'/items'},function(){ 
     this.route('new'), 
     this.route('edit',{path:'/:item_id'}); 
    }), 
    this.resource('abilities',function() { 
     this.route('new'), 
     this.route('edit',{path:'/:ability_id'}); 
    }), 
    this.resource('ships',function(){ 
     this.route('new'), 
     this.route('edit',{path:'/:slug'}); 
    }); 
}); 

export default Router; 

나는 노선에 동적 세그먼트가 문제가 될 수 있다고 생각하지만, 오류가 여전히 심지어 자원을 변경 한 후 내놓았다. 나는 그랬다. 쉼표 대신에 각 줄의 끝에서 나는 그것을 바꾸려고 노력했다. 그러나 그것은 그것도 고치지 않았다. 내가 뭘 잘못하고 있는지에 대한 제안은 인정 될 것이다. 감사!

+0

쉼표가 아닌'this.resource' 및'this.route' 항목 다음에 세미콜론이 필요합니다. 이것은 실제로 프로그램 동작에 영향을 미치지 않을 수도 있지만 js [lh] int는 불만을 갖습니다. 세미콜론을 사용할 때 어떤 오류가보고 되었습니까? –

+0

그게 문제였습니다. 어디에서나 세미콜론을 사용해야했습니다. 나는 노선에 세미콜론을 사용하고 있었지만 자원에는 사용하지 않았다. 고맙습니다! – NicholasJohn16

답변

1

쉼표가 아닌 this.resourcethis.route 항목 뒤에 세미콜론이 필요합니다. 이것은 실제로 프로그램 동작에 영향을 미치지 않을 수도 있지만 js [lh] int는 불만을 갖습니다. 세미콜론을 사용할 때 어떤 오류가보고 되었습니까?

관련 문제