I want to configure my Angular 9 app to display a component differently depending on whether someone is using a mobile device to ivew it. When I used to build the template in Python, there was a user_agents package that would allow me to detect and serve different HTML based on a mobile path
{% load user_agents %}
...
{% if not request|is_mobile and not request|is_tablet %}
<td>{{ item.category }}</td>
<td><a href="{{ item.path }}">{{ item.title }}</a></td>
<td align="center">{{ item.created_on }}</td>
{% else %}
<td>
<div>
{{ item.category }} · {{ item.created_on_fmted }}
</div>
<div>
<a href="{{ item.mobile_path }}">{{ item.title }}</a>
</div>
</td>
{% endif %}
Now that I'm building in Angular, I have the below mat-table for my regular devices
<mat-table #table [dataSource]="dataSource">
<ng-container matColumnDef="category">
<mat-header-cell *matHeaderCellDef> category </mat-header-cell>
<mat-cell *matCellDef="let item">{{ item.category.path }}</mat-cell>
</ng-container>
<ng-container matColumnDef="title">
<mat-header-cell *matHeaderCellDef> item </mat-header-cell>
<mat-cell *matCellDef="let item"><a href='{{ item.path }}'>{{ item.title }}</a></mat-cell>
</ng-container>
<ng-container matColumnDef="date">
<mat-header-cell *matHeaderCellDef> Date </mat-header-cell>
<mat-cell *matCellDef="let item">{{ item.created_on }}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table>
but I'm unclear what the Angular way is to detect if I'm on a mobile device and change the HTML appropriately. I would prefer not to detect screen sizes as that doesn't seem fool proof.