{"version":"1.0","type":"rich","title":"CookieService","description":"This example shows an Angular service class, `CookieService`, that provides typed methods for setting and retrieving browser cookies. It demonstrates a fluent API for specifying cookie expiration in units from milliseconds up to years, converting the requested duration into a `Date` object and calling `document.cookie` to persist the value. The `get` method decodes the cookie string, splits it into key-value pairs, and returns the value for the requested key, or an empty string if absent. The code relies solely on the browser’s native `document.cookie` API and Angular’s `Injectable` decorator.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-7ee0e8edb7686ece6ebf6847de70c940?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}