SelectButton

The SelectButton component is used to choose single or multiple items from a list in the form of buttons. Each item in the list of options is defined as the SelectItem interface with a label-value pair properties. The options are binding through the ngModel property with a two-way binding, which results in the default selection based on the backend component data. A basic example of the select button usage would be as follows:

<p-selectButton [options]="types" [(ngModel)]="selectedType"   
name="basic">
</
p-selectButton>

In the preceding example, all the Prime libraries are collected as an array for the options property. The following screenshot shows a snapshot result of the select button example:

In the preceding example, only one item is selected at a time (single selection) but there is also a possibility to select multiple items using the multiple property (that is, multiple="true"). In this scenario, the selected array list should not point to a null or undefined value.

The select button components support one event callback named onChange, which will be invoked on the click of the default button element.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.55.18