npm install ngx-cookie-service --save
- Add to your module:
import { CookieService } from 'ngx-cookie-service';
- Add
CookieService
to module’s providers. - Inject it into your constructor.
- Use
cookie.get(nameOfCookie)
for getting a specific cookie,
usecookie.set(nameOfCookie,cookieValue)
for adding a new cookie.