Categories

Jan 15 in Angular

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

1 Answer

Jan 15
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’);
Click here to read more about Angular JS
Click here to read more about Insurance

Related questions

Madanswer
Jan 15 in Angular
Mar 3 in DevOps
Aug 4 in Matlab
...