patterntypescriptCritical
Property 'assign' does not exist on type 'ObjectConstructor'
Viewed 0 times
propertyexistdoesobjectconstructornotassigntype
Problem
I am using TypeScript in my application, where I use function:
However, during compilation, I receive the following error:
Do you have any idea how can I get rid of this error?
Object.assign(this.success, success.json())However, during compilation, I receive the following error:
error TS2339: Property 'assign' does not exist on type 'ObjectConstructor'.Do you have any idea how can I get rid of this error?
Solution
You can use type assertion, like this:
(Object).assign(this.success, success.json())Code Snippets
(<any>Object).assign(this.success, success.json())Context
Stack Overflow Q#35959372, score: 147
Revisions (0)
No revisions yet.