本文整理汇总了TypeScript中@angular/core.Renderer2.removeClass方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Renderer2.removeClass方法的具体用法?TypeScript Renderer2.removeClass怎么用?TypeScript Renderer2.removeClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core.Renderer2
的用法示例。
在下文中一共展示了Renderer2.removeClass方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: finishTransition
// Called when a transition has completed.
private finishTransition(transition:Transition):void {
// Unset the Semantic UI classes & styles for transitioning.
transition.classes.forEach(c => this._renderer.removeClass(this._element, c));
this._renderer.removeClass(this._element, `animating`);
this._renderer.removeClass(this._element, transition.directionClass);
this._renderer.removeStyle(this._element, `animationDuration`);
this._renderer.removeStyle(this._element, `display`);
if (transition.direction === TransitionDirection.In) {
// If we have just animated in, we are now visible.
this._isVisible = true;
} else if (transition.direction === TransitionDirection.Out) {
// If we have transitioned out, we should be invisible and hidden.
this._isVisible = false;
this._isHidden = true;
}
if (transition.onComplete) {
// Call the user-defined transition callback.
transition.onComplete();
}
// Delete the transition from the queue.
this._queue.shift();
this._isAnimating = false;
this._changeDetector.markForCheck();
// Immediately attempt to perform another transition.
this.performTransition();
}
示例2: update
private update() {
if (this.inputElement.type === 'text') {
this.renderer.removeClass(this.iElement, 'fa-eye');
this.renderer.addClass(this.iElement, 'fa-eye-slash');
} else {
this.renderer.removeClass(this.iElement, 'fa-eye-slash');
this.renderer.addClass(this.iElement, 'fa-eye');
}
}
示例3: update
private update() {
const inputElement = this.getInputElement();
if (inputElement && inputElement.type === 'text') {
this.renderer.removeClass(this.iElement, 'fa-eye');
this.renderer.addClass(this.iElement, 'fa-eye-slash');
} else {
this.renderer.removeClass(this.iElement, 'fa-eye-slash');
this.renderer.addClass(this.iElement, 'fa-eye');
}
}
示例4: resetBackgroundColor
/**
* [resetBackgroundColor description]
* @method resetBackgroundColor
*/
public resetBackgroundColor(): void {
if (this.currentBackgroundStyle) {
this.renderer2.removeStyle(this.elementRef.nativeElement, this.currentBackgroundStyle.property, this.currentBackgroundStyle.color);
} else if (this.currentBackgroundClass) {
this.renderer2.removeClass(this.elementRef.nativeElement, this.currentBackgroundClass);
}
}
示例5: handleAction
handleAction({ target = null, visible = false }) {
const addClass = visible ? 'active' : 'inactive';
this.renderer.addClass(target, addClass);
const rmClass = visible ? 'inactive' : 'active';
this.renderer.removeClass(target, rmClass);
}
示例6: resetFontColor
/**
* [resetFontColor description]
* @method resetFontColor
* @return [description]
*/
public resetFontColor() {
if (this.currentFontStyle) {
this.renderer2.removeStyle(this.elementRef.nativeElement, 'color', this.currentFontStyle);
} else if (this.currentFontClass) {
this.renderer2.removeClass(this.elementRef.nativeElement, this.currentFontClass);
}
}
示例7: setContainerClass
private setContainerClass(isOpen: boolean): void {
if (isOpen) {
this.renderer.addClass(this.elementRef.nativeElement, 'drawer-opened');
} else {
this.renderer.removeClass(this.elementRef.nativeElement, 'drawer-opened');
}
}
示例8: _setClass
private _setClass(className: string, isAdd: boolean): void {
if (isAdd) {
this._renderer.addClass(this._element.nativeElement, className);
} else {
this._renderer.removeClass(this._element.nativeElement, className);
}
}
示例9: alternateColors
alternateColors(icon: MdcIcon) {
const demoIcon = 'demo-icon-custom-colors';
icon.elementRef.nativeElement.classList.contains(demoIcon) ?
this._renderer.removeClass(icon.elementRef.nativeElement, demoIcon)
: this._renderer.addClass(icon.elementRef.nativeElement, demoIcon);
}
示例10: alternateColors
alternateColors(input: MdcRadio) {
const demoInput = 'demo-radio--custom';
input.elementRef.nativeElement.classList.contains(demoInput) ?
this._renderer.removeClass(input.elementRef.nativeElement, demoInput)
: this._renderer.addClass(input.elementRef.nativeElement, demoInput);
}