The pointer panel is a master/detail component that displays a wrapped list of cards and shows details of the selected card. It has a responsive layout and uses the current material theme. I got the idea from Google images and am using this component mainly for my portfolio.
Live Demo: https://pointerpaneldemo2.firebaseapp.com/
Pointer Panel requires a collection of items and two templates as shown below.
<!--ITEM DETAILS TEMPLATE-->
<ng-template #myItemDetailsTemplate let-dataDetails>
<p>{{dataDetails.jsonData?.fullDesc}}</p>
<ng-template>
<!--ITEM CARD TEMPLATE-->
<ng-template #myItemTemplate let-dataItem>
<p>{{dataItem.jsonData?.name}}</p>;
</ng-template>;
<!-- POINTER PANEL LIST -->
<pointer-panel-list [itemTemplate]='myItemTemplate'
[itemDetailsTemplate]='myItemDetailsTemplate'
[dataSource]='cards$'/>
</pointer-panel-list>
…in the .ts file
public cards: Array<StarWarsModel> = new Array<StarWarsModel>();
cards$ = of( this.cards);Pointer panel uses IteratableDiffer based checking to realize if the underlying data has changed to update the UI so your data changes (such as adding or removing a record) can be inline or return a new collection. For instance, use push, splice, spread, or slice to modify the data source and the pointer panel will update automatically.
dataSource can be an array or an observable, if an array is used then pointer panel will make its own observable.
Pointer panel uses the material theme loaded by the application.
Pointer panel should display properly on all devices.
Angular 6, Material and ngFlex
Below are the features I would add next:
- Add ability to show details in column. Would work better for wide screens. It could auto detect or be set via properties.
- Add configurable height to details panel.
- Add virtualization to the list.
- Add keyboard support to navigate and select the cards.
