-2
  • Is it the same as [(ngModel)] ? Some kind of two-way binding ?

  • I do have the following tag on our project :

             <p-table #tt [value]="universitiesList"[(selection)]="selectedUniversity" [globalFilterFields]="['Name']">
    
  • universitiesList and selectedUniversity are 2 variables which exist on the typescript of this component. I understand that. But are 'value' and 'selection' reserved words ? Why is value writen with [] and selection written within [()] ?

Ty a lot

Code Klaudia
  • 47
  • 1
  • 7

1 Answers1

1
  • [(selection)] is a property of a primeNG table

  • It is a form of two-way-binding

  • When a row / checkbox of the table is selected, the value is saved to that array (the value is saved to the array"selectedUniversity") :

                [(selection)]="selectedUniversity"
    

https://www.primefaces.org/primeng/v8.2.9-lts/#/table/selection :

<p-table [columns]="cols" [value]="cars" selectionMode="single" [(selection)]="selectedCar1" dataKey="vin">

Code Klaudia
  • 47
  • 1
  • 7