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

Поділитися
Вставка
  • Опубліковано 20 лис 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 :)
  • Наука та технологія

КОМЕНТАРІ • 11

  • @CodeSample360
    @CodeSample360 4 місяці тому

    It helps me to understand. Thank you.

    • @ZoaibKhan
      @ZoaibKhan  4 місяці тому

      Glad it helped! ☺️

  • @Humppakarajat
    @Humppakarajat 3 місяці тому

    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  3 місяці тому +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 UA-cam player package!
      If I'm not wrong, the components to be deferred need to be standalone - maybe that is the reason

  • @bishwadeepghosh9140
    @bishwadeepghosh9140 6 місяців тому

    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  6 місяців тому

      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 2 місяці тому

    can @defer replace lazy loading modules?

    • @ZoaibKhan
      @ZoaibKhan  2 місяці тому

      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 2 місяці тому

      @@ZoaibKhan thank you very much. Understood now.

  • @pranavjadhav1136
    @pranavjadhav1136 6 місяців тому

    Hi mat tags are not working.

    • @ZoaibKhan
      @ZoaibKhan  6 місяців тому

      You mean mat tabs?