2016-07-11 5 views

답변

0

setupController 후크로 application.js 경로 내에서 설정할 수있었습니다. I가 분명하지 않다 무엇

export default Ember.Route.extend({ 
    setupController(){ 
     this.notifications.setDefaultAutoClear(true); 
     this.notifications.setDefaultClearNotification(1200); 
    } 
}); 

는 처음 호출 할 경로/컴포넌트/컨트롤러/서비스 또한 setDefaultAutoClear(true) 요구의 내부 후크의 내부에 갈 필요가 있다고했다. 기본값을 사용하려는 경우 문서를 사용한다는 의미가 아니라 문서에없는 것입니다.

1

이 플러그인은 everything에 주입되는 service을 사용

['controller', 'component', 'route', 'router', 'service'].forEach(injectionTarget => { 
    application.inject(injectionTarget, 'notifications', 'notification-messages:service'); 
}); 

그래서 this.notifications 그냥 항상 같은 싱글이다.

관련 문제