本文整理汇总了TypeScript中app/search/search.service.SearchService类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.SearchService类的具体用法?TypeScript service.SearchService怎么用?TypeScript service.SearchService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.SearchService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: ngOnInit
ngOnInit() {
this.searchService.initWorker('app/search/search-worker.js');
this.searchService.loadIndex();
const query = this.locationService.search()['search'];
if (query) {
this.searchBox.nativeElement.value = query;
this.onSearch(query);
}
}
示例2: onSearch
onSearch(query: string, keyCode?: number) {
if (keyCode === 27) {
// Ignore escape key
return;
}
this.locationService.setSearch('Full Text Search', { search: query });
this.searchService.search(query);
}
示例3:
this.searchResults = this.location.currentPath.switchMap(path => {
const query = path.split(/\W+/).join(' ');
return this.search.search(query);
});
示例4: onSearch
onSearch(query: string, keyCode?: number) {
if (keyCode === 27) { // ignore escape key
return;
}
this.searchService.search(query);
}