Create a YouTube sidebar clone with Angular Material Components! (Part 2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ธ.ค. 2024

ความคิดเห็น • 60

  • @fvinodhfranklin
    @fvinodhfranklin 2 หลายเดือนก่อน

    Beautiful Tutorial, 10:26 color is not changing for me tips pls, i am using angular18

    • @ZoaibKhan
      @ZoaibKhan  2 หลายเดือนก่อน +1

      I think that's because of the default material 3 theming. You can individually use the design token for the icon color to override with the primary color

    • @fvinodhfranklin
      @fvinodhfranklin 2 หลายเดือนก่อน

      @@ZoaibKhan Thankyou

  • @geomaticanet
    @geomaticanet 11 หลายเดือนก่อน

    Hi, nice tutorial, but in minute 10:07 i get the error: error NG8003: No directive found with exportAs 'routerLinkActive'. and crash the app. The function of active item doesnt works, any help?

    • @ZoaibKhan
      @ZoaibKhan  11 หลายเดือนก่อน +2

      RouterLinkActive directive is part of the RouterModule, you have that in the imports array right?

    • @emersson7x
      @emersson7x 10 หลายเดือนก่อน

      @@ZoaibKhan Is true 👌👌

  • @henimex
    @henimex 9 หลายเดือนก่อน +2

    Perfect!! mate, thank you! u saved my day

    • @ZoaibKhan
      @ZoaibKhan  9 หลายเดือนก่อน

      You're welcome 🤗

  • @miguelperez6860
    @miguelperez6860 10 หลายเดือนก่อน +1

    thanks ...
    How would it be done in separate components?

    • @ZoaibKhan
      @ZoaibKhan  10 หลายเดือนก่อน

      You can use output in nested container and event handler in parent to handle toggle state

  • @mohammedakhtar1078
    @mohammedakhtar1078 ปีที่แล้ว +1

    nice tutorial. just one issue .. In my case i have a default.component and i have header footer and sidebar component in this case the click of menu button doesnt work ... will u be able to guide

    • @ZoaibKhan
      @ZoaibKhan  ปีที่แล้ว

      You can keep an output in the header which fires when button is clicked. Then use an event handler outside it to toggle the mode

    • @mohammedakhtar1078
      @mohammedakhtar1078 ปีที่แล้ว

      @@ZoaibKhan did that and it worked however i noticed that when it collapses although the icons are showing properly .. there is a scrollbar at the bottom .. any ideas ?

    • @emersson7x
      @emersson7x 10 หลายเดือนก่อน

      In CSS styles, you must remove the img styles. I tried it and the image will be reduced.
      /* img {
      width: 100px;
      height: 100px;
      } */

  • @davoodsoleimani9482
    @davoodsoleimani9482 6 หลายเดือนก่อน +1

    Thanks a lot. I have a problem! When navbar collapsed, and it's width decreased to 64px, an scroll bar appears at bottom of navbar! how can I fix it?

    • @ZoaibKhan
      @ZoaibKhan  6 หลายเดือนก่อน

      Is it a horizontal scrollbar? Also, is it scrolling by small amount or more than that?
      Having the scroll usually means there is more content than what can be shown in that width. So you can try increasing the width a bit to accommodate any extra space so the scrollbar disappears.
      Or you can simply disable scroll by using overflow hidden instead of auto

    • @davoodsoleimani9482
      @davoodsoleimani9482 6 หลายเดือนก่อน

      @@ZoaibKhan Yes, it is a horizontal scrollbar, but why it appears just in my project, while I did all steps as you shown?!
      I set navbar's width to auto, and the width increased to about 100px, that is not nice for collapsed state!

    • @ZoaibKhan
      @ZoaibKhan  6 หลายเดือนก่อน

      @@davoodsoleimani9482 There must be some content which remains in the sidebar increasing its width to 100px. Make sure that content is not there in collapsed state

  • @danielborges.
    @danielborges. ปีที่แล้ว +2

    Greate tutorial. Thanks for sharing.

    • @ZoaibKhan
      @ZoaibKhan  ปีที่แล้ว

      Glad it was helpful, Daniel! Will be posting the third and last part soon as well :)

  • @alanvce
    @alanvce 3 หลายเดือนก่อน

    Thank you very much, this layout helped me a lot, but I am facing a problem when I click in Dashboard, the new component is opening in a new page, and not at the side of menu link. Do you have any idea why it is happening? do you think that the command --inline-template --inline-style can affect this? because I created only using the --standalone command.
    Thank you again.

    • @ZoaibKhan
      @ZoaibKhan  3 หลายเดือนก่อน

      No, it shouldn't have anything to do with inline styles and templates. You should check router outlet and where that is - it should be in sidenav content, so that the route components are opened there

  • @alokagase454
    @alokagase454 4 หลายเดือนก่อน

    Great tutorial.. Inside mat sidenav content I've requirement of loading multiple lazily loaded modules/routes whenever user clicks on that button. can you please help me with this?

    • @ZoaibKhan
      @ZoaibKhan  4 หลายเดือนก่อน

      Just use loadComponent in place of component in the routes file and the routes should be lazily loaded automatically!

  • @IAMKINGOFKINGSLORDOFLORDS
    @IAMKINGOFKINGSLORDOFLORDS 5 หลายเดือนก่อน

    Hi Khan I have a few things which don't match up. One thing is the profile picture seems to be not centered it is off to the left. Another thing is the sidenavbar has a very small height not taking up the full height available and lastly i don't get the highlight of the active route. Can you help please? I am loving your videos.

    • @IAMKINGOFKINGSLORDOFLORDS
      @IAMKINGOFKINGSLORDOFLORDS 5 หลายเดือนก่อน

      I should also add that I have header and footer components and i'd like the hamburger to be in the header as opposed to right below it.

    • @IAMKINGOFKINGSLORDOFLORDS
      @IAMKINGOFKINGSLORDOFLORDS 5 หลายเดือนก่อน

      and where is the Dashboard and other MenuItems icon being set?

    • @ZoaibKhan
      @ZoaibKhan  5 หลายเดือนก่อน +1

      Please go through the styling part more closely, it seems you've missed out some CSS styles. E.g. the height of sidenav is set in the styles

    • @ZoaibKhan
      @ZoaibKhan  5 หลายเดือนก่อน +1

      It's in the menu items array signal defined in the sidenav component

    • @IAMKINGOFKINGSLORDOFLORDS
      @IAMKINGOFKINGSLORDOFLORDS 5 หลายเดือนก่อน

      @ZoaibKhan are you available on a Consulting basis in an advisory role? 30 minutes or 1 hour per day to answer questions? I work for Ministry of Foreign Affairs in Belgium and we are moving all apps to Angular we are building reusable share libraries that will reside in a common separate repository that can be leveraged by any Angular App within the organization using single sign on common components services etc. In short are you available to coach us just a few minutes per day to support our efforts.

  • @alnes204
    @alnes204 หลายเดือนก่อน

    Hey, in version 18, the icons for Material are no longer colored when active....there is only the colored background....so it works as "active" but looks totaly different

    • @ZoaibKhan
      @ZoaibKhan  หลายเดือนก่อน

      Hey! if you want to have the same effect, you can override the following design token CSS variable in the menu item when the item is selected:
      --mdc-list-list-item-leading-icon-color
      I might do a video on this and other changes, but not sure when.

    • @alnes204
      @alnes204 หลายเดือนก่อน

      @@ZoaibKhan Thanks for your answer.
      First ive to change the default border-radius, and then change the color.
      This is how i made it:
      .mat-mdc-nav-list .mat-mdc-list-item {
      border-radius: 0;
      }
      .mat-mdc-nav-list .mat-mdc-list-item.mdc-list-item--activated {
      background-color: transparent;
      > mat-icon,
      span {
      color: #005cbb;
      }
      }
      It works. But I actually don't really like working "against" material.

    • @ZoaibKhan
      @ZoaibKhan  หลายเดือนก่อน +1

      @alnes204 that's why I suggested to use the specific design token CSS variable for the purpose. Overriding internal styles can break things in the future, but the design tokens will not change that much. That is a new feature introduced in v18

    • @alnes204
      @alnes204 หลายเดือนก่อน

      @@ZoaibKhan Hm, it seems not so easy. The icon color is easy to change, but the text color (in nested span) not so easy without messing with ng-deep or also internal classes.....So its a fight against material 😅

    • @ZoaibKhan
      @ZoaibKhan  หลายเดือนก่อน +1

      @alnes204 here's something to make it easier for you! The upcoming v19 material docs will contain a list of all design token variables so it's easier to see the options
      next.material.angular.io/components/but…

  • @manojmunda-mk6hq
    @manojmunda-mk6hq 7 หลายเดือนก่อน +1

    in this add nested sidebar submenues

    • @ZoaibKhan
      @ZoaibKhan  7 หลายเดือนก่อน

      Yup, I'll be creating a video on this as well. Stay tuned

  • @MikoOfiaza
    @MikoOfiaza 4 หลายเดือนก่อน

    I have one small problem after collapsing the sidenav a horizontal scrollopsy appears

    • @ZoaibKhan
      @ZoaibKhan  4 หลายเดือนก่อน

      I can only guess the problem from here since I don't have your code. But seems you haven't set the width to be wide enough to contain the collapsed state?

  • @kashifalikhan4420
    @kashifalikhan4420 หลายเดือนก่อน

    Nicely explained

  • @franciscofdez8334
    @franciscofdez8334 ปีที่แล้ว +1

    Thanks for sharing! 👏

    • @ZoaibKhan
      @ZoaibKhan  ปีที่แล้ว

      You're welcome 🤗

  • @ahmetozden5220
    @ahmetozden5220 9 หลายเดือนก่อน

    I cannot show my other coponents in the router outlet in mat-sidenav-content, how can I solve this? (I have the main root, for example admin/dashboar, I want to show it in the router outlet in mat-sidenav-content.)

    • @ZoaibKhan
      @ZoaibKhan  9 หลายเดือนก่อน

      Could you show me some code so I can understand the layout and guide accordingly?

    • @ahmetozden5220
      @ahmetozden5220 9 หลายเดือนก่อน

      ​@@ZoaibKhan

      For example, I want to run the admin/analytics root on the same page as the sidebar inside the router outlet.

    • @ZoaibKhan
      @ZoaibKhan  9 หลายเดือนก่อน

      @@ahmetozden5220 did you set up the routes correctly? Once you do that, the component you give for that route should be rendered in place of the router outlet.

    • @ahmetozden5220
      @ahmetozden5220 9 หลายเดือนก่อน

      ​@@ZoaibKhan When I created the path:admin/analytics in app.routes.ts with a for loop, I created a series called menuItems as in the video and gave the route value and the analytics value, but when I do this, it opens on its own page, not where the sidebar is (I'm not talking about _blank). )

    • @ahmetozden5220
      @ahmetozden5220 9 หลายเดือนก่อน

      I solved the problem, thank you for your attention

  • @hoangtoan9836
    @hoangtoan9836 ปีที่แล้ว +1

    Great !!! Thanks a lot !!!

    • @ZoaibKhan
      @ZoaibKhan  ปีที่แล้ว

      You are welcome!

    • @hoangtoan9836
      @hoangtoan9836 ปีที่แล้ว

      Hope your new part soon !!!!

    • @ZoaibKhan
      @ZoaibKhan  ปีที่แล้ว

      Hopefully coming up today!

  • @Labiqakhan
    @Labiqakhan 5 หลายเดือนก่อน

    Thankyou.

  • @codeaz5673
    @codeaz5673 13 วันที่ผ่านมา

    done ✅