Angular Tutorial - 24 - Wildcard Route and Redirecting Routes

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

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

  • @erinrivera7697
    @erinrivera7697 6 ปีที่แล้ว +51

    Thank you for all your Angular videos. You are an excellent teacher! I've been through so many videos about Angular 2/5 and you are the first person to actually explain concepts in a clear and concise manner. Thanks again!

    • @zabiullahahmadi6281
      @zabiullahahmadi6281 5 ปีที่แล้ว +3

      checkout mosh hamadani's tutorials also

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

      I second with @Erin Highbaugh.
      Vishwas is an amazing teacher, explaining otherwise dreadful concepts with love, care and focus.

  • @TeluguNerds
    @TeluguNerds 5 ปีที่แล้ว +45

    For latest versions, assign this to routes array [ {
    path: '',
    pathMatch: 'full',
    redirectTo: ''
    },
    {path: 'departments', component: DepartmentListComponent},
    {path: 'employees', component: EmployeeListComponent},
    {path: "**", component: PageNotFoundComponent} ]

  • @HK-sw3vi
    @HK-sw3vi 4 ปีที่แล้ว +1

    this guy be gifted in his teaching methods: clear and concise...

  • @simonemeloni7967
    @simonemeloni7967 5 ปีที่แล้ว +8

    For the updated versions the routes must be added in the following precise order:
    const routes: Routes = [
    {path: '', pathMatch: 'full', redirectTo: ''},
    {path: 'departments', component: DepartmentListComponent},
    {path: 'employees', component: EmployeeListComponent},
    {path: '**', component: PageNotFoundComponent}
    ];
    otherwise it puts the string "Page Not Found" in the "home" page localhost: 4200, instead of typing localhost: 4200 / test as the tutorial says.

    • @RCPN
      @RCPN 5 ปีที่แล้ว

      is there any difference between {path: '', pathMatch: 'full', redirectTo: ''} and {path: ''", pathMatch: 'full', redirectTo: '"'} because for me the latter worked.

    • @kogantieswar5240
      @kogantieswar5240 4 ปีที่แล้ว

      Thank you , it works

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

      Thanks it's working fine now

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

    Beautiful explanation of path match. Thank you Vishwas. I've seen many tutorials, not one of them explained the order and the match prefix/full.

  • @ankurpandey7343
    @ankurpandey7343 4 ปีที่แล้ว

    redirectTo : '/department' ----->>>> redirectTo : 'department' WORKED FOR ME

  • @mrrishiraj88
    @mrrishiraj88 3 ปีที่แล้ว

    Gratitude for all your effort, care and knowledge.

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

    you are the best ive been suffering to learn these things for days

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

    You are awesome. Please carry on.

  • @dskundan
    @dskundan 3 ปีที่แล้ว

    Thank you Sir, you are excellent... keep up the great work!

  • @yogeshttiwari2666
    @yogeshttiwari2666 6 ปีที่แล้ว +10

    wildcard route works but, error-page content always visible on the home page. And this only on the home page whenever I redirect it to another page like employee-list or departments then the only page's content visible but as soon as I redirect on the homepage error-page content reflects again How to fix it...??? Please answer

    • @MichalRutz
      @MichalRutz 5 ปีที่แล้ว +7

      add -> {path: "", pathMatch: 'full', redirectTo: ""},

  • @Juznik1389
    @Juznik1389 6 ปีที่แล้ว

    You are a code/explanation god

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

    wonderful explanation. Still After 4 years.

  • @MrBdoleagle
    @MrBdoleagle 4 ปีที่แล้ว

    great video! you made it very clear and easy to understand. thanks~

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

    Awesome tutorial!!! .helps me a lot :) Thank you.

  • @sreyahepsiba4525
    @sreyahepsiba4525 5 ปีที่แล้ว

    Very nice lecture

  • @ai.aspirations
    @ai.aspirations 5 ปีที่แล้ว

    pretty tutorial thanks much Vishwas

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

    sorry, I have a question - how in the PageNotFound component you could overwrite all page in order to appear only the 'not found' message, and not also the 2 buttons?

  • @syn-eewong8460
    @syn-eewong8460 6 ปีที่แล้ว

    Thank you for your videos!

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

    AMAZING! THANK U!

  • @chagantisubhash
    @chagantisubhash 6 ปีที่แล้ว

    Great explanation!!

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

    instead showing error message on same page how to navigate to show only error message in new page without employee buttons and department buttons

  • @HolyHarmonyOfficial
    @HolyHarmonyOfficial 6 ปีที่แล้ว

    really great! clearly and effective

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

    Great tutorial series. I noticed one thing, leaving out the import routingComponents from the app.module.ts has no effect on the application. And commenting out the line:
    //export const routingComponents = [DepartmentListComponent, EmployeeListComponent];
    from app-routing.moules.ts neither, the application still works normally.

  • @HongKimhia
    @HongKimhia 5 ปีที่แล้ว

    Thanks very much

  • @mudrakpatel7468
    @mudrakpatel7468 6 ปีที่แล้ว +3

    How do I set the default route to be the home page i.e. localhost:4200/ ?

    • @dailyproviders5606
      @dailyproviders5606 6 ปีที่แล้ว +4

      {path : '', redirectTo: '', pathMatch:'full'}

  • @trendingtopics3362
    @trendingtopics3362 3 ปีที่แล้ว

    Marvelous

  • @AhamedKabeer-wn1jb
    @AhamedKabeer-wn1jb ปีที่แล้ว

    Thank you..

  • @tylerfranklin8363
    @tylerfranklin8363 6 ปีที่แล้ว

    You are great.

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

    Then where we can use prefix value ?

  • @sagarmukherjee
    @sagarmukherjee 4 ปีที่แล้ว

    Hi, what to put in redirectTo for paths like # which does not redirect to anywhere?

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

    Hi sir,
    while creating component getting below errors
    PS D:\Study\Medical> ng g c NewMedical -is -it
    Error: Unknown argument: i

  • @Cupofshake
    @Cupofshake 6 ปีที่แล้ว

    Hello, how can I implement that role based navigation. E.g. If user has not logged in, cannot access into routes. If I try to enter any route directory, it redirects into login page..

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

    Hey can you please make video on internationalization

  • @prasunkumarchatterjee3488
    @prasunkumarchatterjee3488 6 ปีที่แล้ว

    I have one question. What is the use of prefix?

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

    Are these videos still good for Angular 6+??? Angular 7??

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

      yes

  • @mohammadrezarahimi1979
    @mohammadrezarahimi1979 6 ปีที่แล้ว

    would it be possible to enable auto generating caption in video 24 to 29

  • @yevgenylevin8381
    @yevgenylevin8381 6 ปีที่แล้ว

    Are you have a courses on Udemy??

  • @seenuvasanv
    @seenuvasanv 6 ปีที่แล้ว

    Thanks.

  • @dulanjayachathura2444
    @dulanjayachathura2444 6 ปีที่แล้ว

    thankz

  • @gururajmoger8649
    @gururajmoger8649 6 ปีที่แล้ว

    please do sidemenu and navigation menus.

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

    can you please open auto-subtitles ?

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

    5:10

  • @sonzkinzminzhoangz3333
    @sonzkinzminzhoangz3333 3 ปีที่แล้ว

    problem with sub in this video

  • @MULAGURA
    @MULAGURA 7 ปีที่แล้ว

    i guess no difference from Angular 4

  • @17001045jv
    @17001045jv 6 ปีที่แล้ว

    Subtitles plz