I was wondering if there was a way to assign class properties via looping/Object.assign, for example something like:
interface Foo {
b: string
a: string
r: number
}
class Example implements Foo {
constructor(ref: Foo) {
Object.assign(this, ref)
}
}
-- Edit -- Error:
Class 'Example' incorrectly implements interface 'Foo'. Type 'Example' is missing the following properties from type 'Foo': b, a, r
Object.assign?