1.0.4 • Published 2 years ago

@kimaya/ngx-cookie-storage v1.0.4

Weekly downloads
1
License
-
Repository
-
Last release
2 years ago

ngx Cookie Storage

This project was generated with 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 kumarganesh088@gmail.com

1.0.4

2 years ago

1.0.2

2 years ago

1.0.3

3 years ago

1.0.1

4 years ago

1.0.0

5 years ago