check if data exists

This commit is contained in:
Cilibiu Bogdan
2019-07-12 08:54:36 +03:00
parent 026157b892
commit 120c030b2b
@@ -58,7 +58,7 @@ import { Router } from '@angular/router';
export class ToggleFavoriteComponent implements OnInit { export class ToggleFavoriteComponent implements OnInit {
@Input() data: any; @Input() data: any;
selection$: Observable<SelectionState>; selection$: Observable<SelectionState>;
private reloadOnRoutes: string[]; private reloadOnRoutes: string[] = [];
constructor( constructor(
private store: Store<AppStore>, private store: Store<AppStore>,
@@ -69,9 +69,11 @@ export class ToggleFavoriteComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.reloadOnRoutes = this.extensionService.runExpression( if (this.data) {
`$( ${this.data} )` this.reloadOnRoutes = this.extensionService.runExpression(
); `$( ${this.data} )`
);
}
} }
onToggleEvent() { onToggleEvent() {