I'm creating an app using angularjs
and typescript
. I am using cookies to store same data about user's login and rights etc. I ran into a problem with angular-cookies.d.ts file.
$cookieStore work just fine but according to AngularJS docs this service has been deprecated, so I tried using $cookies instead.
Using $cookies caused an error while compiling Property 'put' does not exist
so I checked the definition and there is really no property with such name in ICookiesService interface.
declare module "angular-cookies" {
var _: string;
export = _;
}
declare module angular.cookies {
interface ICookiesService {
[index: string]: any;
}
interface ICookieStoreService {
get(key: string): any;
put(key: string, value: any): void;
remove(key: string): void;
}
}
Is there actually an error in this type definition or am I doing something wrong? Thanks for your responses.