@angular/core#Attribute TypeScript Examples

The following examples show how to use @angular/core#Attribute. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: table.ts    From halstack-angular with Apache License 2.0 6 votes vote down vote up
constructor(
    protected readonly _differs: IterableDiffers,
    protected readonly _changeDetectorRef: ChangeDetectorRef,
    protected readonly _elementRef: ElementRef,
    @Attribute("role") role: string,
    @Optional() protected readonly _dir: Directionality,
    @Inject(DOCUMENT) _document: any,
    private resolver: ComponentFactoryResolver,
    private paginationService: PaginationService,
    private sortService: SortService
  ) {
    if (!role) {
      this._elementRef.nativeElement.setAttribute("role", "grid");
    }

    this._document = _document;
    this._isNativeHtmlTable =
      this._elementRef.nativeElement.nodeName === "TABLE";

    this.setClassName();
  }
Example #2
Source File: header.component.ts    From ngx-ui-tour with MIT License 6 votes vote down vote up
constructor(
        @Attribute('id')
        readonly id: string | null,
        @Inject(Clipboard) private readonly clipboard: Clipboard,
        @Inject(TuiNotificationsService)
        private readonly notifications: TuiNotificationsService,
        @Inject(LOCATION) private readonly location: Location,
        @Inject(TUI_COPY_TEXTS) private readonly copyTexts$: Observable<[string, string]>,
        @Inject(TUI_DOC_EXAMPLE_TEXTS) readonly texts: [string, string, string]
    ) {}
Example #3
Source File: canvas-2d.ts    From canvas with MIT License 6 votes vote down vote up
constructor(
        @Inject(CANVAS_2D_CONTEXT) context: CanvasRenderingContext2D,
        @Inject(DrawService) method: CanvasMethod,
        @Attribute('opaque') _opaque: string | null,
        @Attribute('desynchronized') _desynchronized: string | null,
    ) {
        context.strokeStyle = 'transparent';
        method.call = context => {
            context.clearRect(0, 0, context.canvas.width, context.canvas.height);
        };
    }
Example #4
Source File: resize-observer.directive.ts    From resize-observer with MIT License 5 votes vote down vote up
constructor(
        @Inject(ResizeObserverService)
        entries$: Observable<ResizeObserverEntry[]>,
        @Attribute('waResizeBox') _box: ResizeObserverOptions['box'],
    ) {
        this.waResizeObserver = entries$;
    }
Example #5
Source File: font-size.directive.ts    From matx-angular with MIT License 5 votes vote down vote up
constructor( @Attribute('fontSize') public fontSize: string, private el: ElementRef) { }
Example #6
Source File: scroll-to.directive.ts    From matx-angular with MIT License 5 votes vote down vote up
constructor( @Attribute('scrollTo') public elmID: string, private el: ElementRef) { }