Create a Responsive Sidebar Menu with Angular Material

Поделиться
HTML-код
  • Опубликовано: 24 май 2021
  • Learn how to create a #responsive sidebar navigation menu with #Angular #material!
    The complete code is available here.
    github.com/thisiszoaib/angula...
    💖 Support my shop at Buy me a coffee:
    www.buymeacoffee.com/zoaibkha...
    📽️ Full stack Angular + Firebase course (50% off):
    www.udemy.com/course/angular-...
    ✍️My blog for more free Angular posts:
    zoaibkhan.com/blog
    Other socials:
    Twitter - / zoaibdev
    Facebook - / thisiszoaib
    LinkedIn - / zoaib-khan-b6456815
    Cheers :)
  • НаукаНаука

Комментарии • 139

  • @ZoaibKhan
    @ZoaibKhan  2 года назад +3

    Wondering how to add basic routing to this app? Check out my follow up video with a guide on how to add basic routing and a few tweaks to make this even better!
    ruclips.net/video/8hVP6jZ-gOM/видео.html

  • @beezesty
    @beezesty Год назад

    To the point, elegant, short, concise. Wonderful tutorial. Thanks a lot !

  • @alejandroatria983
    @alejandroatria983 Год назад

    Just wanted to thank you for this video! It's really well explained and doesn't go around the bushes. Really great tutorial!

  • @CodeWithAhsan
    @CodeWithAhsan 3 года назад +2

    Clear, concise, and to-the-point tutorial :) Great job Zoaib!

  • @gopalmuthusamy4479
    @gopalmuthusamy4479 2 года назад

    Crispy and Clear content. Thanks for the work!!!

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      You're welcome Jeeva!

  • @ronaksayta8191
    @ronaksayta8191 2 года назад

    I was struggling with this as I am coding after a long time since material 7. This video gave a very nice clarity. Thanks for the tutorial. Keep up the good work.

    • @ZoaibKhan
      @ZoaibKhan  2 года назад +2

      Thanks Ronak! Glad it helped. Are there any other tutorials you'd like? :)

  • @danielborges.
    @danielborges. 3 года назад

    I'm loving your Angular content. I've got a subscriber. Thanks for the work. Take care.

    • @ZoaibKhan
      @ZoaibKhan  3 года назад

      Hey Daniel! Thanks for the compliment and subscription :)
      I'll do my best to bring in more useful content!
      Cheers

  • @luispadron7866
    @luispadron7866 2 года назад

    great job Zoaid! perfect example

  • @pabloaleman1042
    @pabloaleman1042 2 года назад

    Thank you Zoaib, you're the best. Hello from Guatemala!

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Hey Pablo! Hope Guatemala is doing good :)
      Thanks for the kind words!

  • @rationalpi6755
    @rationalpi6755 2 года назад

    Needed this for my work, thank you for much for the tutorial!

  • @wahebbenzaid543
    @wahebbenzaid543 Год назад

    Thank you for your effort Zoaib

  • @cosalamone
    @cosalamone 11 месяцев назад

    Excelent video! Helped me a lot!

  • @alejandradubon9052
    @alejandradubon9052 2 года назад

    What an amazing video! Really thank you very much, you helped me a lot, you saved my life. Thank you for contributing to education and the community. Blessings!

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      You're very welcome, Alejandra! Glad you found it useful :) Feel free to share any other tutorial you'd like and I'll add it to my upcoming list!

  • @jasonwilliams7784
    @jasonwilliams7784 Год назад

    Thank you for thie great tutorial - just what I was looking for! I do have one small issue, which I'm sure is an easy fix - but when you refresh the page, the sidenav and content slide in from the left - I would prefer it just load in the correct position without any slide action - how would I achieve that?

  • @shitsonfireyo
    @shitsonfireyo Год назад

    Thank you soo much! Exactly what I was looking for! :)

  • @fadikariss9626
    @fadikariss9626 Год назад

    Excellent as usual, why don't you make more videos?

  • @mahaahaadi
    @mahaahaadi Год назад

    Thank you sir, today I had deadline to make sidebar, this video helped me a lot and saved time. Thank you. Make more videos.

  • @thankaraj82
    @thankaraj82 2 года назад

    You're awesome. Excellent content. Thanks for your time

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Oh, you're awesome as well :)
      Glad you found it useful!

  • @plumemotorpartpmp1625
    @plumemotorpartpmp1625 Год назад

    I'm from Thailand. Thank you teacher.

    • @ZoaibKhan
      @ZoaibKhan  Год назад

      You're welcome, student! How is Thailand doing? :)

    • @plumemotorpartpmp1625
      @plumemotorpartpmp1625 Год назад

      @@ZoaibKhan it rains every day :)

    • @ZoaibKhan
      @ZoaibKhan  Год назад

      @@plumemotorpartpmp1625 must be fun? :)

  • @petrnaboko8720
    @petrnaboko8720 2 года назад

    Thank you very much! Nice tutorial!

  • @xviovx
    @xviovx Год назад

    great video. thanks a lot!

  • @MonaCodeLisa
    @MonaCodeLisa Год назад

    Very cool video, thank you for sharing :)

    • @ZoaibKhan
      @ZoaibKhan  Год назад +1

      You're welcome, Esther :)

  • @andreaurrea6987
    @andreaurrea6987 Год назад

    Thank you for this tutorial!!!

  • @AleTorres2k
    @AleTorres2k Год назад

    Perfect tutorial oh How to create a responsive sidenav, congratulations and thank you very much man

  • @surajbande5841
    @surajbande5841 2 года назад

    @zoiab
    Really it is to the point.
    Thank for great content!
    Highly appreciate your efforts 👏!

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Thanks Suraj! Means a lot ☺️

  • @vicandres24
    @vicandres24 2 года назад +1

    Gracias por compartir.....
    no se necesita conocer el idioma para entender lo que hiciste....
    me sirvió mucho para mi proyecto...
    gracias!!!

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      ¡De nada, Víctor! Y muy amable de su parte para felicitar :)
      Espero que también encuentres buenos mis otros videos. ¡Los comentarios son siempre bienvenidos!

  • @weslleydavid4299
    @weslleydavid4299 2 года назад

    Thank you for the content !!

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      My pleasure Weslley! :)

  • @arslanghummann
    @arslanghummann 2 года назад

    kindly make more like this for all angular concepts

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Thanks Arslan! What other concepts are you interested in - so I can build upon that? :)

  • @enriqueruiz320
    @enriqueruiz320 2 года назад

    Gracias!!! seguiré el paso a paso :D

  • @Ancode2
    @Ancode2 2 года назад

    That's nice..really appreciate it! Thanks for sharing your knowledge! Please make a video on full admin panel build..

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Thanks Ancode for your feedback! It keeps me going :)
      About a full admin panel build, it's a major project. Can only be discussed in bits and pieces, but will try to come up with something :)

    • @Ancode2
      @Ancode2 2 года назад

      @@ZoaibKhan I would like to watch your hours of work it's simple efficient and easy to understand. Keep uploading Sir.

  • @sergiodeluca9062
    @sergiodeluca9062 2 года назад

    Excelente, gracias por el video

  • @vastekich4039
    @vastekich4039 Год назад

    very useful thanks

  • @SohrabRouzbeh
    @SohrabRouzbeh 2 года назад

    Hi Zoaib, thanks for the excellent tutorial! I have actually implemented this in my project, the problem is when on mobile I navigate to another component with the open sidenav it does not close automatically after routing. Would appreciate if you could help on this

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Could you show me your code a bit in a stackblitz or some other way? It would be difficult to say anything otherwise

  • @goodbookgoodlife
    @goodbookgoodlife 3 года назад

    Awww buddy... seriously helpful for me...

    • @ZoaibKhan
      @ZoaibKhan  3 года назад

      You're welcome Vijay :)

  • @fatemalokhandwala3477
    @fatemalokhandwala3477 2 года назад

    Hi Zoaib, Great Tutorial! Thank you so much for sharing. Also, could you please show me how can I add a submenu in a sidebar?

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Thanks Fatema! You're welcome :)
      For a submenu, you could use a material tree component. Docs here:
      material.angular.io/components/tree/examples
      That could be the subject of another video :)

  • @sekharbabu1173
    @sekharbabu1173 2 года назад

    Very good and clear explanation sir! that helped me a lot. Could you please tell me how to use sidenav mode "over" when there is no sidenav-content? I my project I had decoupled sidenav with content, here in my case, I have removed sidenav-content from sidenav-container and in my app.component.html the code like this








    I'm unable to use sidenav mode="over" and "push". Hope I will get reply or any working example. Thanks in advance

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Thanks Sekhar!
      The sidenav is meant to be used in a certain way, so the main content area has to be wrapped inside the mat sidenav container to work properly. Is there any particular reason why you can't or don't want to do that in your project?

  • @MuhammadIbrahim-tb6bb
    @MuhammadIbrahim-tb6bb Год назад +1

    I have an error in modual.ts (app routing , app component )is not a module please help

  • @axelrodriguez8805
    @axelrodriguez8805 3 года назад +1

    Thank you so much!!!

    • @ZoaibKhan
      @ZoaibKhan  3 года назад

      You're welcome, Alex! :)

  • @yusbelydelgado681
    @yusbelydelgado681 2 года назад

    Cool tutorial, with old material versions it was difficult to me do this, now i'm working with material 12 and this help me soooo much to understand, now in going to programe it. Do you have any tutorial of Modals or Dialogs in material?? Thanks in advance

    • @yusbelydelgado681
      @yusbelydelgado681 2 года назад

      Maybe could you make more tutorials of ViewChild and ViewChildren? 🙌

    • @ZoaibKhan
      @ZoaibKhan  2 года назад +1

      Glad to hear that Yusbely!
      I have a few tutorials about material dialogs. One is about creating reusable material dialogs for confirmation. It's in my video uploads.
      If you want anything specific, I'd love to create one for it :)

    • @yusbelydelgado681
      @yusbelydelgado681 2 года назад +1

      @@ZoaibKhan ok perfect, thank you, I'll see in your channel! 👍🏽

  • @eduardocastillosalazar18
    @eduardocastillosalazar18 Год назад

    buen video pero si quisiera que al dar click en algun enlace tambien se cierre el menú que propiedad debería usar?

    • @ZoaibKhan
      @ZoaibKhan  Год назад

      Hey Eduardo! Please refer to the follow-up video to this in which I add routing and also show how to automatically close the menu on route change.
      ruclips.net/video/8hVP6jZ-gOM/видео.html

  • @mariemneili1433
    @mariemneili1433 2 года назад

    Hello, I really appreciate your work, I have a problem of styling css in the content navbar, when I add a table to the content it won't be responsible ( I but the width of the table to 100% but still don't work) can you help me? Thanks

    • @ZoaibKhan
      @ZoaibKhan  2 года назад +2

      Hey Mariem! Thanks for the compliment. Could you show me the problem in a stackblitz app or a video?

    • @mariemneili1433
      @mariemneili1433 2 года назад +1

      @@ZoaibKhan Thanks for the response, actually the problem was that the content class had : display: flex; when I remove it , it works fine

  • @mansurfit9863
    @mansurfit9863 Год назад

    Thanks bhai you gave me a great experiance on responsive site make more videos for beginner like me

    • @ZoaibKhan
      @ZoaibKhan  Год назад

      Sure. Anything particular you'd like videos on?

  • @berthembenitezjr8612
    @berthembenitezjr8612 Год назад

    Nice video!! Can you create a sidenave angular material half close? I'm struggling with creating the component

    • @ZoaibKhan
      @ZoaibKhan  Год назад +1

      That's a good idea 💡 I'll try to come up with something hopefully 🙂

    • @berthembenitezjr8612
      @berthembenitezjr8612 Год назад

      @@ZoaibKhan ok thank you!!

  • @krishanthadharmasiri5266
    @krishanthadharmasiri5266 2 года назад

    This is awesome, material is super cool, thanks for the great video, can you please do a video on how to change the themes (Dark vs Light)

    • @ZoaibKhan
      @ZoaibKhan  2 года назад +1

      Thanks 🙏 I think you've already found the dark mode video :)

    • @krishanthadharmasiri5266
      @krishanthadharmasiri5266 2 года назад

      @@ZoaibKhan yes great video please keep up the good work

  • @Unknown971
    @Unknown971 2 года назад +3

    Great video! The only thing is how can i do the same thing, but having a "header-component" and a "sidevar-component". how can i get the sidevar on my "layout-component".
    // HTML of the component "layout-component"
    // header code
    // sidenav code

    • @ZoaibKhan
      @ZoaibKhan  2 года назад +1

      Thanks Orion!
      You can do the reverse - instead of accessing the material sidenav out side of your custom component, create two functions inside of it to enable mobile or desktop mode and then add the functionality there.
      Then just use ViewChild in your layout component to call the relevant functions on breakpoint change.

  • @rajatkulhari3795
    @rajatkulhari3795 2 года назад

    ohh !!! too good

  • @yashwantraghuwanshi982
    @yashwantraghuwanshi982 Год назад

    Great!!

  • @gowthamkumar9043
    @gowthamkumar9043 2 года назад

    thanks a lot , and why the space between sidebar navigation and sidenav and how to fill this .

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Hey Gowtham!
      Thanks for the comment. Are you referring to the space on the left side when the sidebar is closed?

  • @danielhorodenko8587
    @danielhorodenko8587 Год назад

    Backdrop is not appearing on 'over' mode, help please!

  • @mdgosoddin192
    @mdgosoddin192 2 года назад

    super bro

  • @thomasmcnamara2896
    @thomasmcnamara2896 Год назад

    Curious why your sidenav bar seems to glide in and out yet mine appears and disappears without any sliding animation. Thoughts?

    • @ZoaibKhan
      @ZoaibKhan  Год назад

      Have you included BrowserAnimationsModule in your app module? Angular material adds that when installing

    • @thomasmcnamara2896
      @thomasmcnamara2896 Год назад

      @@ZoaibKhan Yes I have.

  • @santiagolorduy1379
    @santiagolorduy1379 6 месяцев назад

    Gracias!

  • @eduardomunozm
    @eduardomunozm 5 месяцев назад

    Excellent tutorial!!! Thanks a lot. But I have an error in console after implementation: "ERROR Error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'true'. Current value: 'false'." Any idea?

    • @ZoaibKhan
      @ZoaibKhan  5 месяцев назад

      Check the code in description to see a fix to this.

    • @eduardomunozm
      @eduardomunozm 5 месяцев назад

      @@ZoaibKhan I solved it by adding "private cdRef: ChangeDetectorRef" in the constructor and "this.cdRef.detectChanges();" at the end inside the ngAfterViewInit()

    • @ZoaibKhan
      @ZoaibKhan  5 месяцев назад +1

      @@eduardomunozm that will work as well, but usually we avoid calling change detector directly unless absolutely necessary.

    • @eduardomunozm
      @eduardomunozm 5 месяцев назад

      @@ZoaibKhan I understand, I made the modifications to implement the code as you have it on your Github. Thanks a lot!

  • @gersonlimah5409
    @gersonlimah5409 2 года назад

    very top, muito bom, bueno!

  • @pushpakchintu656
    @pushpakchintu656 Год назад

    How can I contact you sir... I have some important doubts ... Please help me sir

    • @ZoaibKhan
      @ZoaibKhan  Год назад

      What kind of doubts pushpak? You can email on consult@zoaibkhan.com if you can't send a message here

  • @amolgode9843
    @amolgode9843 2 года назад +1

    Great job sir..
    How to add scrollbar to the buttons only..?

    • @ZoaibKhan
      @ZoaibKhan  2 года назад +1

      Thanks Amol!
      You mean add a scroller to the sidebar only?

    • @amolgode9843
      @amolgode9843 2 года назад +1

      @@ZoaibKhan ya but only for buttons not to the profile image..

    • @ZoaibKhan
      @ZoaibKhan  2 года назад +1

      @@amolgode9843 Oh, in that case, you'll need to enclose the buttons in a parent div, then add styling to fix its height and allow scroll with overflow: scroll.

    • @amolgode9843
      @amolgode9843 2 года назад +2

      @@ZoaibKhan thanks..
      :)

    • @amolgode9843
      @amolgode9843 2 года назад +1

      Hii if my interviewers ask me why you choose angular instead of rest framework for this project..?
      So what is best answer for this.. !

  • @fadikariss9626
    @fadikariss9626 Год назад

    I need an admin project with firebase please

  • @z2htechnical
    @z2htechnical 2 года назад

    But how to reuse for entire application that means header and left side navbar

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Simple: add your pages as routes and add a router outlet in content area.

  • @bbbilal
    @bbbilal 2 года назад +2

    Can you tell me how to add router outlets to this?

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      Thanks Bilal!
      You just put in the sidenav content section (where I've added the "Main Content" text). Then just define your routes and they should show up at that place.

    • @nazeersheikh7220
      @nazeersheikh7220 2 года назад

      @@ZoaibKhan it's not working

  • @amolgode9843
    @amolgode9843 2 года назад +1

    Hii sir your videos are so useful. I want to make a chatting app using Django Rest API and Angular, So can you make a beautiful Responsive Angular UI.
    Thank you in advance... ;)

    • @ZoaibKhan
      @ZoaibKhan  2 года назад +1

      I'm thinking about doing a series on building a chat app with firebase. So that might cover the UI part of it as well. Hopefully in a while 🙂

    • @amolgode9843
      @amolgode9843 2 года назад +1

      @@ZoaibKhan Thanks... 😄⭐️⭐️⭐️
      Please start as soon as.. 😊

  • @4321rpraveen
    @4321rpraveen 3 года назад

    how to make a collapsible sidenav ... that is better for a smaller windows..thanks

    • @ZoaibKhan
      @ZoaibKhan  3 года назад

      Hey Praveen!
      Could you show me an example of what you mean by a collapsible sidenav?

    • @sajanat.a7456
      @sajanat.a7456 3 года назад

      @@ZoaibKhan i think its toggle menu

    • @ZoaibKhan
      @ZoaibKhan  3 года назад

      there is a toggle in this as well. Or do you mean some other toggle?

  • @soundarya9195
    @soundarya9195 2 года назад

    where did you get the templates

    • @ZoaibKhan
      @ZoaibKhan  2 года назад

      What templates are you talking about soundarya?

  • @berthembenitezjr8612
    @berthembenitezjr8612 2 года назад

    nice video! i hope you can create more angular framework with angular material websites.... im willing to donate any amount

    • @ZoaibKhan
      @ZoaibKhan  2 года назад +1

      Thanks Berthem! What kind of websites do you mean?

    • @berthembenitezjr8612
      @berthembenitezjr8612 2 года назад

      @@ZoaibKhan can you create a social media app using angular material, ngrx and some advance angular features like lazy loading route, observables and subjects... I hope you can create one...

  • @ein_lappen9140
    @ein_lappen9140 Год назад

    can i do tNice tutorials with the trial version?

  • @victorbernedotapia2010
    @victorbernedotapia2010 Год назад

    F-antastic Genius!!!!

  • @leandrosantosoliveira3878
    @leandrosantosoliveira3878 2 года назад

    Clear, concise, and to-the-point tutorial :) Great job Zoaib!