本文整理汇总了TypeScript中app/shared/location.service.LocationService类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.LocationService类的具体用法?TypeScript service.LocationService怎么用?TypeScript service.LocationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.LocationService类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: ngOnInit
ngOnInit() {
const query = this.locationService.search()['search'];
if (query) {
this.searchBox.nativeElement.value = query;
this.onSearch(query);
}
}
开发者ID:JohnnyQQQQ,项目名称:angular,代码行数:7,代码来源:search-box.component.ts
示例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);
}
开发者ID:JohnnyQQQQ,项目名称:angular,代码行数:8,代码来源:search-box.component.ts
示例3: ngOnInit
ngOnInit() {
const groupName = this.locationService.search()['group'] || '';
// no need to unsubscribe because `contributors` completes
this.contributorService.contributors
.subscribe(grps => {
this.groups = grps;
this.groupNames = grps.map(g => g.name);
this.selectGroup(groupName);
});
}
开发者ID:AnthonyPAlicea,项目名称:angular,代码行数:10,代码来源:contributor-list.component.ts
示例4: 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);
}
}
开发者ID:diestrin,项目名称:angular,代码行数:10,代码来源:search-box.component.ts
示例5: selectGroup
selectGroup(name) {
name = name.toLowerCase();
this.selectedGroup = this.groups.find(g => g.name.toLowerCase() === name) || this.groups[0];
this.locationService.setSearch('', {group: this.selectedGroup.name});
}
开发者ID:AnthonyPAlicea,项目名称:angular,代码行数:5,代码来源:contributor-list.component.ts
注:本文中的app/shared/location.service.LocationService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论