巧用Angular项目的get设置Angular class属性访问的别名

102 阅读1分钟

以this.host为例:

实现位置:

  /**
   * Helper method to return the host element for the directive
   * given by the `elementRef`.
   */
  protected get host(): HTMLElement {
    return this.elementRef.nativeElement;
  }

更多Jerry的原创文章,尽在:“汪子熙”: