I am currently developing a pwa that runs as website for browsers and as app for mobiles. The challenge is that the browser design has elements that differ form the mobile apps, like different header and more funcionalities. I want to use the same code on both.
For now i’m checking the running platform and using different templates. But i think there must be a better way.
Can anyone give me some advice about the best way to implment this?
I Still haven’t found a good solution for this.
I’m already using responsive design when possible, (for example in grid elements to resize the number of columns) and also I am using ngIf when the changes don’t differ a lot. I still feeling forced to use ngTemplates when the views are different.
I hope there is a better solution for this. It would be nice to be able to define different selectors and views for different cases.
With this lib you can add several checks for different screen sizes or devices or browser or many others.
Another big advantage I figured out, showWhen and hideWhen only add display: none to element, but in fact the component is still there. I think this lib is more then an *ngIf, so it is not rendered and so not in the DOM present!
This could be a very big advantage.
It would be very very nice to see something like that in ionic in feature!