angular2-cookie
Implementation of Angular 1.x $cookies service to Angular 2 v1.2.6
Please use >=1.2.4 for Angular >2.0.0, 1.1.x versions for beta, 1.2.2 version is for release candidates earlier than rc.5 and 1.2.3 is for >rc.5.
Table of contents:
Get Started
Installation
You can install this package locally with npm.
# To get the latest stable version and update package.json file: npm install angular2-cookie --save
After installing the library, it should be included in the SystemJS configurations.
/** * System configuration for Angular 2 samples * Adjust as necessary for your application needs. * Taken from: https://github.com/angular/quickstart/blob/master/systemjs.config.js */ { System;}this;
Usage
CookieService class is an injectable service with angular @Injectable()
decorator. Therefore, it needs to be registered in the providers array (encouraged way).
Then, it will be available in the constructor of the component class.
;; ; ;
;;