python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 7, Interview Questions Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
7 Cookies

Angular Cookies methods

What are the cookies methods?
Angular cookies concept is very similar to the Angular 1.x but Angular added only one extra method to delete all cookies.

The All cookie methods are
1.      Check – This method is used to check the cookie existing or not.
2.      Get - This method returns the value of given cookie name.
3.      GetAll - This method returns a value object with all the cookies
4.      Set – This method is used to set the cookies with a name.
5.      Delete – This method used to delete the cookie with the given name
6.      deleteAll – This method is used to delete all the cookies
7.      and so on  

Cookie Methods –
The Angular cookies service contains the following methods.
export declare class CookieService {
    private document;
    private documentIsAccessible;
    constructor(documentany);
    /**
     @param name Cookie name
     @returns {boolean}
     */
    check(namestring): boolean;
    /**
     @param name Cookie name
     @returns {any}
     */
    get(namestring): string;
    /**
     @returns {}
     */
    getAll(): {};
    /**
     @param name    Cookie name
     @param value   Cookie value
     @param expires Number of days until the cookies expires or an actual `Date`
     @param path    Cookie path
     @param domain  Cookie domain
     @param secure  Secure flag
     */
    set(namestringvaluestringexpires?: number | Datepath?: stringdomain?: stringsecure?: boolean): void;
    /**
     @param name   Cookie name
     @param path   Cookie path
     @param domain Cookie domain
     */
    delete(namestringpath?: stringdomain?: string): void;
    /**
     @param path   Cookie path
     @param domain Cookie domain
     */
    deleteAll(path?: stringdomain?: string): void;
    /**
     @param name Cookie name
     @returns {RegExp}
     */
    private getCookieRegExp(name);
}

ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions