I have a singal in service:
export class AuthService {
constructor(private cookieService: CookieService) {}
url = 'http://localhost:8000/api/v1/login';
token: string = '';
isAuthenticated = signal<Boolean>(false);
changeIsAAuthenticated() {
this.isAuthenticated.set(false);
console.log(this.isAuthenticated);
}
getIsAAuthenticated() {
return this.isAuthenticated;
}
and in route guard i want to get its value:
let authService = inject(AuthService);
console.log(authService.isAuthenticated);
and i get:
function getter()
How to read a value of a singal?
I tried:
getValue, value, get or writing a getter but it didnt work.
console.log(authService.isAuthenticated);
console.log(authService.getIsAAuthenticated());
return function getter()
I should have see the value just by console.log it, but it doesnt work.