@@ -40,7 +40,8 @@ bootstrap: [RootComponent]
4040declare class PubSubService {
4141 private events: Object ;
4242 $pub(event : string , eventObject ? : any ): void ;
43- $sub(event : string ): <Observable <number >>;
43+ $sub(event : string ): <Observable <any >>;
44+ $sub(event : string , callback : (value : any ) => void , error ? : (error : any ) => void , complete ? : () => void ): Subscription ;
4445}
4546```
4647
@@ -59,7 +60,7 @@ export class OverlayComponent implements OnInit, OnDestroy {
5960}
6061```
6162
62- #### PubSubService.$sub(event: stirng): Observable<number >
63+ #### PubSubService.$sub(event: stirng): Observable<any >
6364
6465Subscribe to channel.
6566
@@ -71,12 +72,19 @@ export class NavigationComponent implements OnInit, OnDestroy {
7172 constructor (private pubsub : EventDispatcherService ) { }
7273
7374 ngOnInit() {
75+ // usage of $sub(event: string): <Observable<any>>;
7476 this .closeSidenavSub = this .pubsub .$sub (' pleaseCloseSidenav' ).subscribe ((from ) => {
7577 from ? this .sidenavOpened = false : void 0
7678 });
79+
80+ // usage of $sub(event: string, callback: (value: any) => void, error?: (error: any) => void, complete?: () => void): Subscription;
81+ this .openSidenavSub = this .pubsub .$sub (' pleaseOpenSidenav' , (from ) => {
82+ from ? this .sidenavOpened = false : void 0
83+ });
7784 }
7885 ngOnDestroy() {
7986 this .closeSidenavSub .unsubscribe ();
87+ this .openSidenavSub .unsubscribe ();
8088 }
8189` ` `
8290
0 commit comments