CanMatch Guard in Angular 14.1 Router (2022)

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

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

  • @DecodedFrontend
    @DecodedFrontend  2 ปีที่แล้ว +12

    One more note regarding the canMatch guard I forgot to mentioned in the video: canMatch guard is being called during the "Route Recognizing" and "Applying Redirects" steps, so that's why the canMatch will be called 2 times. Keep in mind that and don't be surprised.

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

      Thanks for video, nice information in short time, Please let me know how to avoid one of call from canMatch if it is called twice or How to detect "Route Recognizing" and "Applying Redirects" steps?

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

    I love your content. And owe my current job to your tutorials

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

      🙏 thank you so much! I am so happy to hear that my tutorials could help. I wish you success with your career 😊

  • @МихаилКрамер-н7ш
    @МихаилКрамер-н7ш 2 ปีที่แล้ว +1

    Usually I don't like to watch videos, but yours are really very useful. I show them to all my employees

  • @rdbstrd1216
    @rdbstrd1216 2 ปีที่แล้ว

    thanks for best angular lessons on yt!

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

    You are really great. Probably the best channel about angular i've found for a while.

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

    Thanks for the video! I published a library called `ngx-feature-flag-router`, and I'm happy to see that `CanMatch` will likely replace it completely. Thank you again for your video, time to look into a new idea

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

      Congratulations on the library 🎉 btw Angular 15.1 was released today and got canLoad deprecated in favor of canMatch

    • @moomoomamoo
      @moomoomamoo 2 ปีที่แล้ว

      @@DecodedFrontend haha yea you called it

    • @DecodedFrontend
      @DecodedFrontend  2 ปีที่แล้ว

      Oh, I just noticed your “super thanks”. Thank you for supporting me:)

  • @lesnoy_leo
    @lesnoy_leo 2 ปีที่แล้ว

    Best channel about Angular what i ever seen.

  • @Someone-tn8ur
    @Someone-tn8ur ปีที่แล้ว

    Thank you for a concise, well explained video!

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

    this video is much more usefull than official documentation

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

    everything is very clear, thank you for such quality material

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

    He explains very well. I Google searched about canMatch and couldn't find anything as comprehensive as this video. I also bought his course on angular forms which is very detailed. I hope he could make more courses about other angular advanced topics and less about interview related things. There is really a lack of recent comprehensive courses/tutorials on angular, Decoded Frontend is the exception.

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

    Nice use case, thank you for the video!

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

    Quality content as always 💪

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

    Hi, Dmytro. I'm Nelson from Peru. When we using preloading-strategy for example PreloadAllModules, in this case "canLoad" will not be preloaded because it is protected by CanLoad route guard. Now what about canMatch is possible to do the same? Or how can I avoid to preload some modules?

    • @warforum-w1x
      @warforum-w1x 6 หลายเดือนก่อน

      Nice question, what is your opinion regarding this? @DecodedFrontend

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

    Please make a video on Micro Frontend using Module Federation

  • @hubert.t4243
    @hubert.t4243 2 ปีที่แล้ว +1

    Thanks!

    • @DecodedFrontend
      @DecodedFrontend  2 ปีที่แล้ว

      Sorry, just noticed your super thanks. Thank you so much for your support! :)

  • @angelpellejero8764
    @angelpellejero8764 2 ปีที่แล้ว +4

    Super interesting as always, thank you for your videos

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

    Danke!

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

      Hi Severin! Vielen Dank für die Unterstützung, ich schätze es :)

    • @severinspoerri3036
      @severinspoerri3036 2 ปีที่แล้ว

      @@DecodedFrontend 😁👌

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

    Great, as usual!

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

    Thank you for your time and effort!!!

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

    Clear and to the point explanation

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

    Not sure why you do this, but I have to admit this is very professional. Hope your content will get more traction

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

    thanks for your excellent work Dmytro, looking forward to seeing the angular best or bad practices video.

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

    Is it too bad to using ngIf instead? Thks

  • @ТауекелАлтынбеков-о9ъ
    @ТауекелАлтынбеков-о9ъ 2 ปีที่แล้ว +1

    Дуже дякую!

  • @VasilyPavlik
    @VasilyPavlik 2 ปีที่แล้ว

    Thank you very much!!! This is exactly what I need right now and had to implement in Guard with custom redirection.

  • @Isa-oo8mz
    @Isa-oo8mz 2 ปีที่แล้ว

    Great video thanks. Could you please record video about harness and use in custom harness another custom harness?

  • @nguyenhoa7759
    @nguyenhoa7759 2 ปีที่แล้ว

    Awesomeee video 🔥 Thank you!

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

    Useful and shared, thanks for your work.😁

  • @yt.mhasan
    @yt.mhasan 2 ปีที่แล้ว

    Your video helps me a lot. Thank you, sir.

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

    Great video and feature. I wish it was available months ago, I could have used it while doing similar thing when I needed to toggle routes based on feature flags

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

    Thanks Dmitro!

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

    Thanks a lot for this video.

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

    this is gold

  • @VitaliiPolulikh
    @VitaliiPolulikh 2 ปีที่แล้ว

    very nice content as always!!!

  • @youbielu
    @youbielu 2 ปีที่แล้ว

    Extremely good work, keep it up!

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

    Hi. In the 2:41 you say data in the data resolving, Angular is resolving data. But you said exactly the same in the Route Config loading. What is the difference? Thank you.

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

    I have used CanMatch to display a login component.
    So i have 3 routes which, the first will render the login, if the user is not logged in.
    The second will redirect to dashboard and the third has the complete routings as children which has a canActivate guard (login)

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

    Thanks 🙏

  • @MStoica
    @MStoica 2 ปีที่แล้ว

    Off topic: HX monitor arm is the best! 😁 functionality and looks beautiful
    Now let me get back to the video and watch it 😁 interesting new route guard

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

    So great ❤❤

  • @wasit-shafi
    @wasit-shafi 6 หลายเดือนก่อน

    Thanks for such a informative video, i just have one question is there any advantage of using isAdmin$ as observable then just a primitive boolean variable, i have seen this type of pattern at various places, still not fully satisfied when to use which...? Thanks I will highly appreciate incase anyone can comment on this issue

  • @metorado
    @metorado 2 ปีที่แล้ว

    Thanks man🎉

  • @deveshwarjaiswal9095
    @deveshwarjaiswal9095 2 ปีที่แล้ว

    make a video on ssr setup and build for nx/angular app

  • @hubert.t4243
    @hubert.t4243 2 ปีที่แล้ว

    Thanks man :)

  • @binnyranakoti2876
    @binnyranakoti2876 2 ปีที่แล้ว

    Really like your videos everything is explained smoothly
    I have shared your content with my fellow angular Developers and they also liked it.. only one question i have do you have QnA link something where i can get help from you... Thanks

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

    Very useful

  • @dj_yamato
    @dj_yamato 2 ปีที่แล้ว

    Круто. Спасибо за новую информацию !

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

    Sir i got a question, the canMatch guard it is a replacement only for canLoad guard? or it is for canActivate too?

    • @11ujujz47
      @11ujujz47 ปีที่แล้ว

      Only for canLoad

  • @dashti812009
    @dashti812009 2 ปีที่แล้ว

    Hoi, another amazing video, thanks! I have one question, is it possible to get queryParams (ex: get 'id' from url 'dashboard?id=100') in canMatch ?

  • @volodymyralexandrov6040
    @volodymyralexandrov6040 2 ปีที่แล้ว

    Nice!

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

    This is potentially useful for the project I'm working on.
    But how does this behave with a resolver? I'm doing the redirects on the resolver and ideally the redirect logic should be on this canMatch guard.
    Not sure how to use them both together..

    • @DecodedFrontend
      @DecodedFrontend  2 ปีที่แล้ว

      Resolvers are being executed right before the route activation (after canActivate & canActivateChild successfully passed), so if canMatch return 'false' you won't even reach resolvers because canMatch guard will be executed as the very first one in the navigation lifecycle. But why do you do redirect logic inside the resolvers?

    • @pedrofernandes2005
      @pedrofernandes2005 2 ปีที่แล้ว

      @@DecodedFrontend I use resolver to request information to pass to the component. But depending on the state of this item (has two states) I need to decide which route should take.
      In theory, from what I understood, canMatch would be a great candidate for this? But I can't figure out how I would use it.

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

    Thanks sir

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

    ❤❤

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

    Very interestiong. U need to write a book) Cлава україні доречі)

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

      I am a bad writer 😁 Героям слава;)

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

    Крутой видос, но rout всё же читатся как руут, а не роут.

  • @manjeetdigitalstudio
    @manjeetdigitalstudio 2 ปีที่แล้ว

    god bless u xdd

  • @vitruvianeli
    @vitruvianeli 2 ปีที่แล้ว

    comment

  • @Bukratusi
    @Bukratusi 2 ปีที่แล้ว

    Brother please make videos more often a d please create a complete courses for rxjs and angular and please can you create a angular project with advance features. Like amazon filter search

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

    Great video! this opend up to more possibilities. But, I tried it in my own project and bum into and error: 'canMatch' does not exist in type 'Route'. angular. What it might be?

    • @DecodedFrontend
      @DecodedFrontend  2 ปีที่แล้ว

      It might be because your Angular version is below 14.1. Try to update Angular to the latest version and try again:)

  • @bonnes04
    @bonnes04 2 ปีที่แล้ว

    Very useful