Skip to content

Commit 8b90d99

Browse files
committed
125969: Move constructor to server-cookie.service
This makes it possible to remove the REQUEST import from cookie.service.ts which solves a typescript issue.
1 parent 404ccd9 commit 8b90d99

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/app/core/services/cookie.service.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import { Inject, Injectable } from '@angular/core';
2-
3-
import { REQUEST } from '@nguniversal/express-engine/tokens';
4-
1+
import { Injectable } from '@angular/core';
52
import { Subject , Observable } from 'rxjs';
63
import { CookieAttributes } from 'js-cookie';
74

@@ -22,9 +19,6 @@ export abstract class CookieService implements ICookieService {
2219
protected readonly cookieSource = new Subject<{ readonly [key: string]: any }>();
2320
public readonly cookies$ = this.cookieSource.asObservable();
2421

25-
constructor(@Inject(REQUEST) protected req: any) {
26-
}
27-
2822
public abstract set(name: string, value: any, options?: CookieAttributes): void;
2923

3024
public abstract remove(name: string, options?: CookieAttributes): void;

src/app/core/services/server-cookie.service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
import { Injectable } from '@angular/core';
1+
import { Injectable, Inject } from '@angular/core';
22
import { CookieAttributes } from 'js-cookie';
33
import { CookieService, ICookieService } from './cookie.service';
4+
import { REQUEST } from '@nguniversal/express-engine/tokens';
45

56
@Injectable()
67
export class ServerCookieService extends CookieService implements ICookieService {
78

9+
constructor(@Inject(REQUEST) protected req: any) {
10+
super();
11+
}
12+
813
public set(name: string, value: any, options?: CookieAttributes): void {
914
return;
1015
}

0 commit comments

Comments
 (0)