npm install ngx-cookie-service --save- Add to your module:
import { CookieService } from 'ngx-cookie-service'; - Add
CookieServiceto 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.