本文整理汇总了TypeScript中@angular/core.Renderer2.removeStyle方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Renderer2.removeStyle方法的具体用法?TypeScript Renderer2.removeStyle怎么用?TypeScript Renderer2.removeStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core.Renderer2
的用法示例。
在下文中一共展示了Renderer2.removeStyle方法的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: updateTransform
private updateTransform():void {
this._renderer.removeStyle(this._element.nativeElement, "transform");
this._renderer.removeStyle(this._element.nativeElement, "-webkit-transform");
if (this.service.isVisible &&
this.service.transition !== SidebarTransition.Overlay &&
this.service.transition !== SidebarTransition.ScaleDown) {
const translate = `translate3d(${this.service.width}px, ${this.service.height}px, 0)`;
this._renderer.setStyle(this._element.nativeElement, "transform", translate);
this._renderer.setStyle(this._element.nativeElement, "-webkit-transform", translate);
}
}
示例3:
this.animate(this._element.nativeElement.offsetHeight, this._element.nativeElement.scrollHeight, true, () => {
// Remove the overflow override to enable user styling once again.
this._renderer.removeStyle(this._element.nativeElement, "overflow");
this._isCollapsing = false;
this._isExpanded = true;
});
示例4: 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);
}
}
示例5: 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);
}
}
示例6: _setStyle
private _setStyle(nameAndUnit: string, value: string|number|null|undefined): void {
const [name, unit] = nameAndUnit.split('.');
value = value != null && unit ? `${value}${unit}` : value;
if (value != null) {
this._renderer.setStyle(this._ngEl.nativeElement, name, value as string);
} else {
this._renderer.removeStyle(this._ngEl.nativeElement, name);
}
}
示例7: checkRoleAccess
private checkRoleAccess(featureEnabled: boolean) {
const hasRoleAccess = this.authService.securityInfo.canAccess(this.dataflowAppRoles);
if (!featureEnabled || !hasRoleAccess) {
this.renderer.setStyle(this.elem.nativeElement, 'display', 'none');
} else {
if (this.existingDisplayPropertyValue) {
this.renderer.setStyle(this.elem.nativeElement, 'display', this.existingDisplayPropertyValue);
} else {
this.renderer.removeStyle(this.elem.nativeElement, 'display');
}
}
}
示例8: checkRoleAccess
private checkRoleAccess() {
const user: User = this.authService.getUser();
const hasRoleAccess = user.hasAnyRoleOf(this.appRoles);
if (!hasRoleAccess) {
this.renderer.setStyle(this.elem.nativeElement, 'display', 'none');
} else {
if (this.existingDisplayPropertyValue) {
this.renderer.setStyle(this.elem.nativeElement, 'display', this.existingDisplayPropertyValue);
} else {
this.renderer.removeStyle(this.elem.nativeElement, 'display');
}
}
}
示例9: removeStyle
private removeStyle(r: Renderer2, el: any, style: string, flags: RendererStyleFlags2) {
r.removeStyle(el, style, flags);
}
示例10: disable
disable(): void {
this.renderer.removeStyle(document.body, 'overflow');
this.renderer.removeStyle(document.body, 'padding-right');
}