my-test123
Version:
A planner front-end for Fabric8.
28 lines • 1.09 kB
JavaScript
import { Injectable } from '@angular/core';
var CookieService = /** @class */ (function () {
function CookieService() {
}
CookieService.prototype.setCookie = function (cName, cValue) {
document.cookie = cName + "=" + JSON.stringify(cValue);
};
CookieService.prototype.getCookie = function (itemLength) {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
if (cookies[i].includes('datatableColumn')) {
var array = cookies[i].split('=');
if (array.length > 1 && Array.isArray(JSON.parse(array[1])) && JSON.parse(array[1]).length === itemLength) {
return { status: true, array: JSON.parse(array[1]) };
}
}
}
return { status: false, array: [] };
};
CookieService.decorators = [
{ type: Injectable },
];
/** @nocollapse */
CookieService.ctorParameters = function () { return []; };
return CookieService;
}());
export { CookieService };
//# sourceMappingURL=cookie.service.js.map