I'm currently developing an application that requires displaying different views depending on whether the site is accessed from a desktop or mobile device. While I already have a responsive design in place, I want to incorporate ionic components for a better mobile experience (essentially a PWA). What would be the most effective approach to achieve this dual view functionality?
At the moment, my approach involves using a single template with a flag that detects the browser userAgent and then renders the views using simple ngIf statements like:
<div *ngIf="isMobile">
Mobile screen
</div>
<div *ngIf="!isMobile">
Desktop Screen
</div>