import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
-import { AuthService } from '@app/core'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier } from '@app/core'
import { forkJoin, Subscription } from 'rxjs'
import { SearchService } from '@app/search/search.service'
import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
private route: ActivatedRoute,
private router: Router,
private metaService: MetaService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private searchService: SearchService,
private authService: AuthService
) { }
this.search()
},
- err => this.notificationsService.error('Error', err.text)
+ err => this.notifier.error(err.text)
)
}
this.firstSearch = false
},
- error => {
- this.notificationsService.error(this.i18n('Error'), error.message)
- }
+ err => this.notifier.error(err.message)
)
}
}
private updateTitle () {
- this.metaService.setTitle(this.i18n('Search') + ' ' + this.currentSearch)
+ const suffix = this.currentSearch ? ' ' + this.currentSearch : ''
+ this.metaService.setTitle(this.i18n('Search') + suffix)
}
private updateUrlFromAdvancedSearch () {