2013-06-13 3 views

답변

4

을 사용하고 있습니다.

일반적으로 내장 된 엠버 클래스를 수정하지 않는 것이 좋습니다. 대안은 응용 프로그램 특정 기본 클래스를 사용하는 것입니다. 오브젝트를 정의 할 때 이러한 기본 클래스를 사용하여 전역 변경을 수행 할 수있는 좋은 장소가되도록하십시오. 그래서 뭔가가 :

App.Route = Ember.Route.extend({}); 

App.Route.reopen({ 
    enter: function() { 
    console.log('App.Route.enter()', this.toString()); 
    return this._super(); 
    } 
}); 

App.IndexRoute = App.Route.extend({ 
    //Index route code here 
}) 

App.PostsRoute = App.Route.extend({ 
    //Post route code here 
}) 
+0

감사합니다. – Cliff

관련 문제