File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 this . messageService = messageService ;
55 this . logger = logger ;
66
7- this . init ( ) ;
7+ this . activate ( ) ;
88 }
99
10- init ( ) {
11- this . loadMessages ( ) . then ( ( ) => {
10+ activate ( ) {
11+ return this . loadMessages ( ) . then ( ( ) => {
1212 this . logger . info ( 'init Home View' ) ;
1313 } ) ;
1414 }
1717 loadMessages ( ) {
1818 return this . messageService . findAll ( ) . then ( response => {
1919 this . messages = response ;
20+
21+ return this . messages ;
2022 } ) ;
2123 }
2224}
Original file line number Diff line number Diff line change 2727 } ) ;
2828 } ) ;
2929
30- describe ( '#init ' , ( ) => {
30+ describe ( '#activate ' , ( ) => {
3131
3232 beforeEach ( ( ) => {
3333 _inject ( ) ;
3434 } ) ;
3535
3636 it ( 'should be defined' , ( ) => {
3737 homeCtrl = controllerFactory ( 'MessagesCtrl' , mock ) ;
38- expect ( typeof homeCtrl . init ) . toBe ( 'function' ) ;
38+ expect ( typeof homeCtrl . activate ) . toBe ( 'function' ) ;
3939 } ) ;
4040
4141 it ( 'should set messages property' , ( ) => {
You can’t perform that action at this time.
0 commit comments