Questions tagged [angular-canload]

8 questions
5
votes
1 answer

canLoad in children routes using NgRx

I'm working in an Angular 9 app and I'm trying to load (or not) an specific module only when my app state (ngrx) have a property != null First, I have an AuthGuard in my routes but with canActivate. So I want the 'dashboard' module only loads when…
Sergio Mendez
  • 1,311
  • 8
  • 33
  • 56
3
votes
3 answers

Angular7: CanLoad Auth guard hangs browser

I have created an AuthGuard Service and implemented CanLoad interface to it, as shown below import { Injectable } from '@angular/core'; import { CanLoad, Router } from '@angular/router'; @Injectable({ providedIn: 'root' }) export class AuthGuard…
Varun Sukheja
  • 6,170
  • 5
  • 51
  • 93
1
vote
1 answer

How to fix canLoad issue when we are returning an observable with 404 exception

I am trying to call an API in canLoad event for a module in my angular application, Even though that API is not available and gives 404 in network, still my page is loading. I wanted to avoid that situation if there is 404 then I wanted to redirect…
vinod j
  • 83
  • 1
  • 12
0
votes
0 answers

Angular canLoad not working with webpack module federation

I had an anugular 14 app which was using canLoad to guard a lazy loaded module. It was working as expected. Then I added ng add @angular-architects/module-federation@14.3.14 --project mainapp --port 5000 to this app. Once I added module federation…
0
votes
1 answer

I am developing an ionic app in which i am using auth guards. The auth guards are not letting screnn load

I am using auth guards in ionic. this is the code in auth guads service in which i am using canload import { Injectable } from '@angular/core'; import { CanLoad } from '@angular/router'; import { AuthenticationService } from…
0
votes
2 answers

Ionic Auth Gaurd canLoad based on public boolean array

Situation: I'm busy developing an online course where the user has to go through a series of pages in order, but I want to keep them from navigating to other pages. If they attempt to, the current page just loads again. My idea: I created a public…
0
votes
2 answers

How to store user data in local storage using Capacitor’s Storage Plugin?

I am trying to add Firebase Authentication to my Angular app. Here is the signUp() method in my AuthService: signUp(email: string, password: string, name: string) { const userCredential = from( …
-1
votes
2 answers

canLoad guard doesn't get the updated value

UPD. Solved. I was using 2 instanses of a service and it caused problems I'm stuck with canLoad guard. When i push a button in component I want to change the false value in service and let my Guard to load a module. But guard only receives a false…
Max M
  • 1
  • 3