Answer the question
In order to leave comments, you need to log in
How to make a mobile version of the site on Angular?
For a personal project, you need to implement a mobile version in Angular (m.site.com). But I don't have any experience in Angular development. Consider first job.
How to make a mobile version of the site on Angular?
Answer the question
In order to leave comments, you need to log in
https://developer.mozilla.org/ru/docs/Web/CSS/Medi...
Works not only for angular.
I thought about it and came to the obvious conclusion: I'm dumb
const maxMobileWidthPx = 600;
const isMobile = () => {
return window.innerWidth <= maxMobileWidthPx;
}
const routes: Routes = [
{
path: '', pathMatch: 'full',
redirectTo: isMobile() ? 'mobile' : 'desktop'
},
{
path: 'desktop', component: DesktopComponent
},
{
path: 'mobile', component: MobileComponent
}
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question