# ngx Cookie Storage

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.1.0.

## How to install
    
       npm install @kimaya/ngx-cookie-storage
    
## How to use
1. add `CookieStorage` into `AppModule` `providers` list.
        
        import { BrowserModule } from '@angular/platform-browser';
        import { NgModule } from '@angular/core';
        import { AppComponent } from './app.component';
        import { CookieStorage } from 'ngx-cookie-storage';
        
        @NgModule({
          declarations: [
            AppComponent
          ],
          imports: [
            BrowserModule
          ],
          providers: [ CookieStorage ],
          bootstrap: [AppComponent]
        })
        export class AppModule {
        }

    
2. inject `CookieStorage` into `Component` constructor

        constructor(private cookieStorage: CookieStorage){
        }
    
## Functions for cookie Storage
    To check wheather cookie exist or not.
    check(name: string): boolean;
    
    To get value of passed cookie name
    get(name: string): string;
    
    To fetch value of cookie for object
    getObject(name: string): any;
    
    To fetch all cookies for defined domain
    getAll(): {};
    
    To set cookie and object as value
    setObject(name: string, value: object | any, cookieOptions?: CookieStorageOptions): void;
    
    To set cookie and value
    set(name: string, value: string, cookieOptions?: CookieStorageOptions): void;
    
    To delete specific cookie
    delete(name: string): void;
    
    To delete all cookies at once
    deleteAll(): void;


## For more Information 
you can contact on <code>kumarganesh088@gmail.com</code>
