Hii sonal, You need to create one AuthComponent.service.ts And creat one class in it like export calsss AuthGuard { Function_name() { If (your condition) { return true; } else { return false;} } }
In routing file import this file and use it like {path: 'home', component:HomeComponent, [AuthGuard] } I hope it is work for you. On Sat 11 May, 2019, 11:30 AM sonal sonavane, <sonal...@gmail.com> wrote: > Hi All, > > I am new to angular and trying to figure out how to access components that > have AuthGuard activated without the need to login into my application. > > My application needs to be logged in to access any of the forms in it. but > I also need to access one form through shared URL. for this, I need to > bypass logging into the application and just access this form using URL? > How can access this form component through URL while bypassing the login? I > also want to make sure the security of the application would not be > compromised. And same for the form that needs to be accessed without a > login. > > I am using Angular 7. > > Thanks, > Sonal > > -- > You received this message because you are subscribed to the Google Groups > "Angular and AngularJS discussion" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to angular+unsubscr...@googlegroups.com. > To post to this group, send email to angular@googlegroups.com. > Visit this group at https://groups.google.com/group/angular. > To view this discussion on the web visit > https://groups.google.com/d/msgid/angular/625eaad1-6ea0-40d1-8a1c-0baf74e8164e%40googlegroups.com > <https://groups.google.com/d/msgid/angular/625eaad1-6ea0-40d1-8a1c-0baf74e8164e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/CA%2BQXFh7-PrrK4eh0t4Fju5Zd0TRH_u31t---qD6S%2BS4j9%2Bakjw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.