I'm on single page app using typescript and angular. I'm using ng.Resource to fetch data from webapi
productResource.get({ userName: login.userName, password: login.password }, (data: Models.ICompany) => {
this.localStorageService.set<Models.ICompany>("CompanyData", data);
});
I've added angular-local-storage.d.ts file and also installed angularlocalstorage
but when I try to store the promise returned from webapi I'm getting an error "unable to get propery 'set' of undefined or null reference". Also I could not find 'set' / 'get' methods in angular-local-storage.js file. I'm guessing the error is producing because the 'set'/'get' methods are unknow in .js file.
Could you please help me to resolve this issue.
Or is there any best way to store the data in browser using angular.
this.localStorageServiceis undefined. Are you sure you have created it?static $inject = ['LocalStorageModule']or however it is called and then in the constructorconstructor(private localStorageModule'){}. Without seeing your code it is not easy to help though