I am creating an application using angularjsand typescript. I use cookies to store the same data about logins and user rights, etc. I encountered a problem with the angular-cookies.d.ts file.
$ cookieStore is working fine, but according to AngularJS docs this service is deprecated, so I tried using $ cookie instead. Using $ cookies caused a compilation error Property 'put' does not exist, so I checked the definition and there really is no property with that name in the 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 a mistake in defining this type or am I doing something wrong? Thank you for your responses.
source
share