libs/ui/select/src/lib/trigger/select-trigger.component.ts
Allows the user to customize the trigger that is displayed when the select has a value.
changeDetection | ChangeDetectionStrategy.OnPush |
encapsulation | ViewEncapsulation.None |
exportAs | tsSelectTrigger |
host | { |
selector | ts-select-trigger |
template |
|
Properties |
Inputs |
Accessors |
id | |
Type : string
|
|
Define an ID for the component |
Protected _id |
Type : string
|
Default value : this.uid
|
Public Readonly uid |
Default value : `ts-select-trigger-${nextUniqueId++}`
|
Define the default component ID |
id | ||||||
getid()
|
||||||
setid(value: string)
|
||||||
Define an ID for the component
Parameters :
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;
}