0 votes
in Angular by
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

0 votes
asked Feb 24 in Angular by SakshiSharma
+1 vote
asked Jan 24, 2022 in Angular by sharadyadav1986
...