Closed elmiguel closed 7 years ago
Hi @elmiguel
Could you post the steps to reproduce this issue?
[]'s
Sure,
First I installed via npm:
npm install ng2-cookies --save
I imported the package to the main app (although doesn't seem to be injectable?):
import { Cookie } from 'ng2-cookies'
But the I removed it and isolated it to a service.
Then in my service I try to check/set/edit my cookies:
import { Cookie } from 'ng2-cookies'
//.. other imports
// ... code ...
@Injectable()
export class SiteSearchService {
// ...code .. constructor, etc
search(term: string) {
if(!Cookie.check('cookie-name')) {
Cookie.set('cookie-name', term)
}
}
}
It seems to be working now after I cleared node_modules and reinstalled via yarn. I think it was an issue when installing it the first time.
Importing the Cookie class and trying to do a check causes an Error: import { Cookie } from 'ng2-cookies/ng2-cookies'
Cookie.check('cookName')
Error in web pack build: Property 'check' does not exist on type 'typeof Cookie'
Set and Gets do not work as well, as there is nothing in the dev console or storage of the newly created (attempted) cookies.
Tried some tests:
None of these tests have work as of yet.