Angular 2 cookies concept is very similar to the Angular 1.x but Angular2 added only one extra method to remove all cookies i.e. removeAll()
The All cookie methods are
You can create your own functions to get cookie value, set cookie value and delete cookie value.
Two ways to create cookies -
1. You can inject a service in the components providers.
2. You can get it via npm.
npm install angular2-cookie --save
Example - You can get it via npm
The full example for creating your own functions as,
Example 2 - You can inject a service in the components providers