Skip to content

How to extend the CookieService #248

Answered by pavankjadda
JatinChimote asked this question in Q&A
Discussion options

You must be logged in to vote

@JatinChimote Create it like this. You can not have private member with same name in extended class


@Injectable({
	providedIn: 'root',
})
export class MyCookieService extends CookieService {
	constructor(
		@Inject(DOCUMENT) document: Document,
		@Inject(PLATFORM_ID) platformId
	) {
		super(document, platformId);
	}
}

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pavankjadda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants