File

libs/ui/select/src/lib/trigger/select-trigger.component.ts

Description

Allows the user to customize the trigger that is displayed when the select has a value.

Example

Metadata

changeDetection ChangeDetectionStrategy.OnPush
encapsulation ViewEncapsulation.None
exportAs tsSelectTrigger
host {
}
selector ts-select-trigger
template
<ng-content></ng-content>

Index

Properties
  • Protected _id
  • Public Readonly uid
Inputs
Accessors

Inputs

id
Type : string

Define an ID for the component

Properties

Protected _id
Type : string
Default value : this.uid
Public Readonly uid
Default value : `ts-select-trigger-${nextUniqueId++}`

Define the default component ID

Accessors

id
getid()
setid(value: string)

Define an ID for the component

Parameters :
Name Type Optional
value string No
Returns : void
import {
  ChangeDetectionStrategy,
  Component,
  Input,
  ViewEncapsulation,
} from '@angular/core';


// Unique ID for each instance
let nextUniqueId = 0;


/**
 * Allows the user to customize the trigger that is displayed when the select has a value.
 *
 * @deprecated Please use `TsSelectionListTriggerDirective`
 */
@Component({
  selector: 'ts-select-trigger',
  template: `<ng-content></ng-content>`,
  host: {
    'class': 'ts-select-custom-trigger qa-select-custom-trigger',
    '[attr.id]': 'id',
  },
  changeDetection: ChangeDetectionStrategy.OnPush,
  encapsulation: ViewEncapsulation.None,
  exportAs: 'tsSelectTrigger',
})
export class TsSelectTriggerComponent {
  /**
   * Define the default component ID
   */
  public readonly uid = `ts-select-trigger-${nextUniqueId++}`;

  /**
   * Define an ID for the component
   *
   * @param value
   */
  @Input()
  public set id(value: string) {
    this._id = value || this.uid;
  }
  public get id(): string {
    return this._id;
  }
  protected _id: string = this.uid;
}

result-matching ""

    No results matching ""