mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(aio): disable search on browsers that don't support web workers
This commit is contained in:
parent
9326e062d8
commit
11505fa0d8
1 changed files with 5 additions and 2 deletions
|
|
@ -108,8 +108,11 @@ export class AppComponent implements OnInit {
|
|||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.searchService.initWorker('app/search/search-worker.js');
|
||||
this.searchService.loadIndex();
|
||||
// Do not initialize the search on browsers that lack web worker support
|
||||
if ('worker' in window) {
|
||||
this.searchService.initWorker('app/search/search-worker.js');
|
||||
this.searchService.loadIndex();
|
||||
}
|
||||
|
||||
this.onResize(window.innerWidth);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue