Skip to content

Type 'string' is not assignable to type 'Level' #39

Closed
@vcorr

Description

@vcorr

I get this error for at least the version 0.2.3. I can't yet update to 0.3.0.

Line: /angular2-logger/app/core/logger.ts:59:38

Related to this? https://basarat.gitbooks.io/typescript/content/docs/tips/stringEnums.html

changing the line 59 from:
private _loadLevel = (): Level => localStorage.getItem( this._storeAs );
to
private _loadLevel = (): Level => +localStorage.getItem( this._storeAs );

Seems to fix it (converts string to number)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions