本文整理汇总了TypeScript中angular2/core.HostListener函数的典型用法代码示例。如果您正苦于以下问题:TypeScript HostListener函数的具体用法?TypeScript HostListener怎么用?TypeScript HostListener使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HostListener函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: onBlur
@HostListener('blur', ['$event'])
public onBlur(e){
var formGroup = this.getFormGroup(this._elementRef.nativeElement.parentElement);
if(formGroup){
$(formGroup).popover('hide');
}
}
开发者ID:LVM-IT,项目名称:spa-prototype,代码行数:7,代码来源:help.ts
示例2: onServerListChanged
/**
* listen from {@link ServerListComponent}
*
* @param e
*/
@HostListener('ServerListChanged', ['$event']) onServerListChanged(e) {
this.selectedMBeanServer = null;
this.selectedMBeanDomain = null;
this.domains = null;
this.mbeans = null;
this.servers = e;
}
开发者ID:angelndevil2,项目名称:dseew,代码行数:12,代码来源:mbean.explorer.component.ts
示例3: onSelectServer
/**
* listen from {@link ServerListComponent}
*
* @param e
*/
@HostListener('ServerSelected', ['$event']) onSelectServer(e) {
this.selectedMBeanServer = null;
this.selectedMBeanDomain = null;
this.domains = null;
this.mbeans = null;
this.selectedServer = e;
}
开发者ID:angelndevil2,项目名称:dseew,代码行数:12,代码来源:mbean.explorer.component.ts
示例4: onClick
@HostListener('click')
public onClick() {
if (!this._platformInformationService.isMobile) {
}
document.body.classList.remove('sidebar-open');
}
开发者ID:artiso-solutions,项目名称:vokabelchef-web,代码行数:7,代码来源:closeSidebarOnClickDirective.ts
示例5: onBlur
@HostListener('blur', ['$event'])
onBlur(e) {
this.focus = false;
if(this.autoResize) {
this.resize();
}
}
开发者ID:EBozan,项目名称:primeng,代码行数:8,代码来源:inputtextarea.ts
示例6: onFocus
@HostListener('focus', ['$event'])
onFocus(e) {
this.focus = true;
if(this.autoResize) {
this.resize();
}
}
开发者ID:EBozan,项目名称:primeng,代码行数:8,代码来源:inputtextarea.ts
示例7: click
@HostListener('click', ['$event'])
public click(event:MouseEvent):boolean {
event.stopPropagation();
if (!this._service.menuElement.nativeElement.contains(event.target)) {
this._service.toggle();
}
return false;
}
开发者ID:rapropos,项目名称:ng2-semantic-ui,代码行数:9,代码来源:dropdown.directive.ts
示例8:
@HostListener('dblclick', ['$event.target'])doubleClicked(btn) {
console.log("delete item");
console.log(this.el.id);
console.log(this.el.children[1]);
var url = "http://127.0.0.1:5000/delete";
var paras = {'name' : this.el.id}
this.httpMethod.postMethod(url, paras).subscribe(
suc => {
console.log("post suc");
console.log(suc);
window.location.href = "./index.html";
},
err => console.log("post err"),
fin => console.log("post fin")
);
}
开发者ID:gsrr,项目名称:Ret_toDo,代码行数:17,代码来源:rowdecorate.directive.ts
示例9: onKeyUp
@HostListener('keyup', ['$event'])
public onKeyUp(e) {
// F1 is pressed
if(e.keyCode===112){
var formGroup = this.getFormGroup(this._elementRef.nativeElement.parentElement);
if(formGroup){
$(formGroup).popover('toggle')
}
e.stopPropagation();
}
if(e.keyCode===27){
var formGroup = this.getFormGroup(this._elementRef.nativeElement.parentElement);
if(formGroup){
$(formGroup).popover('hide')
}
e.stopPropagation();
}
}
开发者ID:LVM-IT,项目名称:spa-prototype,代码行数:19,代码来源:help.ts
示例10: onKeydown
@HostListener('keydown', ['$event'])
public onKeydown(event:KeyboardEvent):void {
if (event.which !== 40 && event.which !== 38) {
return;
}
event.preventDefault();
event.stopPropagation();
let elems = this.dd.menuEl.nativeElement.getElementsByTagName('a');
switch (event.which) {
case (40):
if (typeof this.dd.selectedOption !== 'number') {
this.dd.selectedOption = 0;
break;
}
if (this.dd.selectedOption === elems.length - 1) {
break;
}
this.dd.selectedOption++;
break;
case (38):
if (typeof this.dd.selectedOption !== 'number') {
return;
}
if (this.dd.selectedOption === 0) {
// todo: return?
break;
}
this.dd.selectedOption--;
break;
default: break;
}
elems[this.dd.selectedOption].nativeElement.focus();
}
开发者ID:EcoLogicAG,项目名称:ng2-bootstrap,代码行数:40,代码来源:dropdown-keyboard-nav.directive.ts
注:本文中的angular2/core.HostListener函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论