Angular Material Responsive Navigation Tutorial
Why Stack Overflow recommends it
Stack Overflow users link it as the walkthrough they followed for an Angular Material responsive sidenav, usually when asking why the generated nav does not render or style correctly.
Recommended by 1 people across 1 different months, 2018 to 2021.
What it is
A roughly 19-minute Academind tutorial by Max that shows how to build a responsive navigation for an Angular app using Angular Material, including the toolbar, sidenav and the generated material-nav schematic. It is part of a longer Angular Material guide with linked code.
What people said
Recommends Mises · 2019-07 · Stack Overflow · on “Collapse not working in Angular navbar for mobile”
I'm posting the best way using Angular Material library to make sidenav as main nav of your application. You no need to install any other librarys then Angular Material npm i --save @angular/material @angular/cdk @angular/animations ng add @angular/material Here is a code: [LINK] Here is an video tutorial: [this video] And in your app.component.html: <sidenav-autosize-example> <router-outlet></router-outlet> </sidenav-autosize-example> And remember to import nessesery modules to your project: import { NgModule } from '@angular/core'; import { MatSidenavModule, MatToolbarModule, MatButtonModule, MatIconModule, MatProgressBarModule } from '@angular/material'; @NgModule({ declarations: [], imports:
Cites Zakariah Siyaji · 2018-07 · Stack Overflow · on “ng generate @angular/material:material-nav --name=main-nav generates files correctly but they do not run”
I ran a simple command that should generate prebuilt files that would be ready to use as a nav-bar. It downloads correctly but if I add <main-nav></main-nav> to my app.component.html page, it will simply output a blank page. There are no errors in my console. The following is the command: ng generate @angular/material:material-nav --name=main-nav I am using a Mac, Angular 6, and Angular Material. The following is the video that I was following: [this video] . I've tested each part independently and have found that the <mat-sidenav></mat-sidenav> function does not work at all.
Cites Roadman1991 · 2019-01 · Stack Overflow · on “Angular material toolbar not inheriting from angular materials”
I want to integrate a nav bar on the left side of my application. But the inheriting in css seems not to work. the nav toolbar should inherit like in the video the style from angular material "IF" I got it right. Right now there is basically nothing inherited. I have no errors in the console and im sure, I have imported roboto etc. I'm guided with a youtube video since I'm new in this field: [this video] I updated my npm and ng. Furthermore I used 'ng add @angular/material' for making sure everything is configured and imported correctly. app.module.ts: import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule } from '
Cites Ole · 2019-09 · Stack Overflow · on “Responsive Navigation with Angular 8 Material Sidenav?”
I've seen various implementations (Including this youtube) [this video] that implement a responsive navigation for the Angular Material Sidenav using media queries. For Angular 8 do we still need custom media queries / CDK Media Queries to implement this, or is there a way to do it declaratively with the component? My goal is to implement a responsive sidenav similar to the one used in the Angular Material Documentation [LINK] .
Cites MrTheBarintokyo · 2019-09 · Stack Overflow · on “Angular Material Nav Sidebar only shows on responsive resizing”
I'm following this video ( [this video] ) tutorial on how to set-up Angular Material Sidenav with the toolbar, but it only seems to take effect as soon as I resize my page. I do not know if it is a glitch on my side, or if I missed something minor. Doesn't show the menu icon on page load (even if page starts on mobile size) [LINK] Shows menu icon as soon as page resizes to a mobile size [LINK] import { Component } from '@angular/core'; import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { Observable } from 'rxjs'; import { map, share } from 'rxjs/operators'; @Component({ selector: 'app-nav-bar', templateUrl: './nav-bar.component.html', styleUrls: ['./nav-bar.component.cs
Cites Niroshan · 2020-04 · Stack Overflow · on “Angular Material: material-nav generate does not working”
I want to create a responsive side nav. I watched a video on youtube. click here to see that video [this video] After, I enter below command to the terminal ng generate @angular/material:material-nav -name=nav But it give an error as below, Unknown option: '-e' How to resolve that? My Package.json as below, { "name": "euc", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "~8.2.14", "@angular/cdk": "~8.2.3", "@angular/common": "~8.2.14", "@angular/compiler": "~8.2.14", "@angular/core": "~8.2.14", "@angular/forms": "~8.2.14", "@angular/material":
Cites sriramcu · 2021-06 · Stack Overflow · on “Why is the CSS not being applied in my Angular project that uses the Angular Materials Side Nav Bar?”
I have just started learning Angular and came across this tutorial [this video] on how to use Angular materials side nav bar. However, when I followed the steps in the tutorial, the website displayed did not use CSS. These were the steps I followed: Create my Angular application. Execute ng generate @angular/material:navigation Import necessary modules in the modules.ts file. Put <app-nav></app-nav> into the app.component.html file. And this was the output [LINK] . Edit- I even tried copying the contents of main-nav.component.css to the global styles.css as suggested in this Stack Overflow answer [LINK] , but to no avail.