mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-06 18:45:08 +00:00
(core) Use inject for dependencies
This commit is contained in:
parent
eb43394ed1
commit
e884ccafe8
|
@ -1,5 +1,5 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { AuthUtils } from 'app/core/auth/auth.utils';
|
||||
import { UserService } from 'app/core/user/user.service';
|
||||
import { catchError, Observable, of, switchMap, throwError } from 'rxjs';
|
||||
|
@ -8,16 +8,8 @@ import { catchError, Observable, of, switchMap, throwError } from 'rxjs';
|
|||
export class AuthService
|
||||
{
|
||||
private _authenticated: boolean = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
private _httpClient: HttpClient,
|
||||
private _userService: UserService,
|
||||
)
|
||||
{
|
||||
}
|
||||
private _httpClient = inject(HttpClient);
|
||||
private _userService = inject(UserService);
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Accessors
|
||||
|
|
|
@ -7,13 +7,6 @@
|
|||
|
||||
export class AuthUtils
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor()
|
||||
{
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,20 +1,14 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Navigation } from 'app/core/navigation/navigation.types';
|
||||
import { Observable, ReplaySubject, tap } from 'rxjs';
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class NavigationService
|
||||
{
|
||||
private _httpClient = inject(HttpClient);
|
||||
private _navigation: ReplaySubject<Navigation> = new ReplaySubject<Navigation>(1);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _httpClient: HttpClient)
|
||||
{
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Accessors
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,20 +1,14 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { User } from 'app/core/user/user.types';
|
||||
import { map, Observable, ReplaySubject, tap } from 'rxjs';
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class UserService
|
||||
{
|
||||
private _httpClient = inject(HttpClient);
|
||||
private _user: ReplaySubject<User> = new ReplaySubject<User>(1);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _httpClient: HttpClient)
|
||||
{
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Accessors
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
@ -40,7 +34,7 @@ export class UserService
|
|||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get the current logged in user data
|
||||
* Get the current signed-in user data
|
||||
*/
|
||||
get(): Observable<User>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user