本文整理汇总了TypeScript中@angular/core.Renderer.setElementClass方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Renderer.setElementClass方法的具体用法?TypeScript Renderer.setElementClass怎么用?TypeScript Renderer.setElementClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core.Renderer
的用法示例。
在下文中一共展示了Renderer.setElementClass方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setTimeout
() => {
this.renderer.setElementClass(lanimation, 'hidden', true);
this.renderer.setElementClass(lelement, 'hidden', true);
setTimeout(() => $(lanimation).remove() , 200)
setTimeout(() => $(lelement).remove() , 200)
}
示例2: mouseLeave
@HostListener('mouseleave')
public mouseLeave() {
if (this.ulChild) {
this.renderer.setElementClass(this.ulChild, 'js-dropdown-active', false);
this.renderer.setElementClass(this.el.nativeElement, 'is-active', false);
}
}
示例3: delayTime
@Input('cardInit')
set delayTime(loading: Observable<any>) {
// build additional templating for loader
this.viewContainerRef.createEmbeddedView(this.templateRef);
var card = this.templateRef.elementRef.nativeElement.nextSibling;
var lelement = this.renderer.createElement(card, 'md-card-loading-overlay');
var lanimation = this.renderer.createElement(card, 'md-card-loading-animation');
this.renderer.setElementClass(lanimation, 'fa', true);
this.renderer.setElementClass(lanimation, 'fa-spinner', true);
this.renderer.setElementClass(lanimation, 'fa-pulse', true);
this.renderer.setElementClass(lanimation, 'fa-3x', true);
this.renderer.setElementClass(lanimation, 'fa-fw', true);
// handle data completion
loading.subscribe(
() => { },
error => {
this.renderer.setElementClass(lanimation, 'hidden', true);
var errormsg = this.renderer.createElement(lelement, 'h3');
this.renderer.setText(errormsg, error);
setTimeout(() => $(lanimation).remove() , 200)
},
() => {
this.renderer.setElementClass(lanimation, 'hidden', true);
this.renderer.setElementClass(lelement, 'hidden', true);
setTimeout(() => $(lanimation).remove() , 200)
setTimeout(() => $(lelement).remove() , 200)
}
)
}
示例4: click
@HostListener('click')
public click() {
if (this.ulChild) {
this.renderer.setElementClass(this.ulChild, 'js-dropdown-active', true);
this.renderer.setElementClass(this.el.nativeElement, 'is-active', true);
}
}
示例5: _updateIcon
private _updateIcon() {
if (this._isFavorite) {
this._renderer.setElementClass(this._el.nativeElement, "active", true);
} else {
this._renderer.setElementClass(this._el.nativeElement, "active", false);
}
}
示例6: updateActiveFlag
updateActiveFlag(selectedLanguage) {
if (this.jhiActiveMenu === selectedLanguage) {
this.renderer.setElementClass(this.el.nativeElement, 'active', true);
} else {
this.renderer.setElementClass(this.el.nativeElement, 'active', false);
}
}
示例7: setColorClass
public setColorClass(): void {
if ( this.object.isGood() ) {
this.renderer.setElementClass(this.el.nativeElement, 'status-bad', false);
this.renderer.setElementClass(this.el.nativeElement, 'status-good', true);
}
else {
this.renderer.setElementClass(this.el.nativeElement, 'status-good', false);
this.renderer.setElementClass(this.el.nativeElement, 'status-bad', true);
}
}
示例8: mouseEnter
@HostListener('mouseenter')
public mouseEnter() {
if (this.ulChild) {
let siblings = this.el.nativeElement.parentElement.children;
for (let sibling of siblings) {
for (let child of sibling.children) {
this.renderer.setElementClass(child, 'js-dropdown-active', false);
}
}
this.renderer.setElementClass(this.ulChild, 'js-dropdown-active', true);
this.renderer.setElementClass(this.el.nativeElement, 'is-active', true);
}
}
示例9: ngOnInit
ngOnInit() {
let children = this.el.nativeElement.children;
for (let child of children) {
if (child.nodeName === 'UL' && child.classList.contains('menu')) {
this.ulChild = child;
}
}
let topLevel = this.el.nativeElement.parentElement.hasAttribute('dropdown-menu');
if (!topLevel) {
this.renderer.setElementClass(this.el.nativeElement, 'is-submenu-item', true);
}
if (this.ulChild) {
this.renderer.setElementClass(this.ulChild, 'is-dropdown-submenu', true);
this.renderer.setElementClass(this.ulChild, 'menu', true);
this.renderer.setElementClass(this.ulChild, 'submenu', true);
this.renderer.setElementClass(this.ulChild, 'vertical', true);
this.renderer.setElementClass(this.el.nativeElement, 'is-dropdown-submenu-parent', true);
this.renderer.setElementClass(this.el.nativeElement, 'opens-right', true);
if (topLevel) {
this.renderer.setElementClass(this.ulChild, 'first-sub', true);
}
}
}
示例10: setTimeout
setTimeout(() => {
this.renderer.setElementClass(
this.el.nativeElement,
animationName,
false
);
}, 600);