当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Renderer2.removeStyle方法代码示例

本文整理汇总了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();
    }
开发者ID:edcarroll,项目名称:ng2-semantic-ui,代码行数:33,代码来源:transition-controller.ts

示例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);
        }
    }
开发者ID:edcarroll,项目名称:ng2-semantic-ui,代码行数:13,代码来源:sidebar-sibling.ts

示例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;
        });
开发者ID:edcarroll,项目名称:ng2-semantic-ui,代码行数:7,代码来源:collapse.ts

示例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);
   }
 }
开发者ID:virtualghost4,项目名称:angular-admin-lte,代码行数:12,代码来源:color.service.ts

示例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);
   }
 }
开发者ID:virtualghost4,项目名称:angular-admin-lte,代码行数:11,代码来源:color.service.ts

示例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);
    }
  }
开发者ID:IdeaBlade,项目名称:angular,代码行数:10,代码来源:ng_style.ts

示例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');
     }
   }
 }
开发者ID:BoykoAlex,项目名称:spring-cloud-dataflow-ui,代码行数:12,代码来源:roles.directive.ts

示例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');
      }
    }
  }
开发者ID:ghillert,项目名称:botanic-ng,代码行数:15,代码来源:roles.directive.ts

示例9: removeStyle

 private removeStyle(r: Renderer2, el: any, style: string, flags: RendererStyleFlags2) {
   r.removeStyle(el, style, flags);
 }
开发者ID:Cammisuli,项目名称:angular,代码行数:3,代码来源:renderer.ts

示例10: disable

 disable(): void {
   this.renderer.removeStyle(document.body, 'overflow');
   this.renderer.removeStyle(document.body, 'padding-right');
 }
开发者ID:SrgGs,项目名称:ng-zorro-antd,代码行数:4,代码来源:nz-block-scroll-strategy.ts


注:本文中的@angular/core.Renderer2.removeStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。