Angular 17 Defer block: Create Lazy Loaded Material Tabs UI with `when` trigger!

Sdílet
Vložit
  • čas přidán 20. 11. 2023
  • #Angular #Defer #Tabs
    Learn how to create a lazy loaded material tabs UI in Angular v17 using the new defer block with the `when` trigger. It's really powerful!
    Code on github: github.com/thisiszoaib/angula...
    Want to learn how to create a full stack application with Angular and Firebase? Grab my new course 'Angular Firebase Authentication: Create Full Sign up App' with 50% off here:
    www.udemy.com/course/angular-...
    Follow for more Angular tutorials, tips and tricks:
    Twitter - / zoaibdev
    Facebook - / thisiszoaib
    LinkedIn - / zoaib-khan-b6456815
    Cheers :)
  • Věda a technologie

Komentáře • 11

  • @CodeSample360
    @CodeSample360 Před 5 měsíci

    It helps me to understand. Thank you.

  • @Humppakarajat
    @Humppakarajat Před 4 měsíci

    Great video mate!
    Unfortunately @defer only works with components which are part of your application. It does not work with components which are located in a library.

    • @ZoaibKhan
      @ZoaibKhan  Před 4 měsíci +1

      Thanks :)
      Third party components will be deferred if you encapsulate them in your own component. I recall I did it in another video with the CZcams player package!
      If I'm not wrong, the components to be deferred need to be standalone - maybe that is the reason

  • @bishwadeepghosh9140
    @bishwadeepghosh9140 Před 7 měsíci

    how a standalone component will be lazy loaded in angular 17 based on routing, like we use ng module as of now, and if we will use ngodule only what is the use of standalone components

    • @ZoaibKhan
      @ZoaibKhan  Před 7 měsíci

      It's much simpler with standalone components. There's a new function called loadComponent which you can use directly in your routes. Link to official docs:
      angular.io/guide/standalone-components#routing-and-lazy-loading

  • @meghadeshpande6806
    @meghadeshpande6806 Před 2 měsíci

    can @defer replace lazy loading modules?

    • @ZoaibKhan
      @ZoaibKhan  Před 2 měsíci

      Defer is meant to be used for component level granular lazy loading. Route level lazy loading can be done with modules and components both. If you're thinking of replacing lazy loading of modules, then look towards the lazy loading of the parent component by using loadChildren in the routes file.

    • @meghadeshpande6806
      @meghadeshpande6806 Před 2 měsíci

      @@ZoaibKhan thank you very much. Understood now.

  • @pranavjadhav1136
    @pranavjadhav1136 Před 7 měsíci

    Hi mat tags are not working.