Selectively toggles nodes as favorites.
<adf-toolbar>
<button mat-icon-button
(toggle)="done()"
[adf-node-favorite]="documentList.selection">
</button>
</adf-toolbar>
<adf-document-list #documentList ...>
...
</adf-document-list>
@Component({ selector: 'my-component' }) class MyComponent { done() { // ... } }
Name | Type | Default value | Description |
---|---|---|---|
selection | NodeEntry [] | [] | Array of nodes to toggle as favorites. |
Name | Type | Description |
---|---|---|
error | EventEmitter <any> | Emitted when the favorite setting fails. |
toggle | EventEmitter <any> | Emitted when the favorite setting is complete. |
You can bind the directive instance to a template variable through the adfFavorite reference, which also lets you add extra styling to the element:
<button
mat-menu-item
#selection="adfFavorite"
[ngClass]="{ 'icon-highlight': selection.hasFavorites() }"
[adf-node-favorite]="documentList.selection">
<mat-icon [ngClass]="{ 'icon-highlight': selection.hasFavorites() }">
{{ selection.hasFavorites() ? 'star' : 'star_border' }}
</mat-icon>
</button>
The directive behaves as follows:
See the Demo Shell for examples of usage.
© 2023 Alfresco Software, Inc. All Rights Reserved.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.