in Angular by
Q:
In Angular, describe how will you set, get and clear cookies?

1 Answer

0 votes
by
For using cookies in Angular, you need to include a  module called ngCookies angular-cookies.js.

To set Cookies – For setting the cookies in a key-value format ‘put’ method is used.

cookie.set('nameOfCookie',"cookieValue");

To get Cookies – For retrieving the cookies ‘get’ method is used.

cookie.get(‘nameOfCookie’);

To clear Cookies – For removing cookies ‘remove’ method is used.

cookie.delete(‘nameOfCookie’);

Related questions

+1 vote
asked Sep 8, 2020 in Service Now by Hodge
0 votes
asked Jan 6, 2020 in Angular by sharadyadav1986
...