Can you explain how to use $cookies in AngularJS within Angular 4/5?
Here's an example using AngularJS:
let app = angular.module('myApp', ['ngCookies']);
app.controller('MainController', MainController);
MainController.$inject = ['$scope', '$cookies'];
function MainController($scope, $cookies){
$cookies.put('msg', 'Hello World');
$scope.msgFromCookie = $cookies.get('msg');
}