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

▼ Show 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’);
Angular JS
Learn More with Madanswer

Related questions

0 votes
asked Dec 4, 2020 in Amazon Elastic Compute Cloud EC2 by sharadyadav1986
...