Consider the scenario where I have the given object:
export interface File {
id: string;
displayname: string;
filesize: number;
isarchived: boolean;
userId: string;
[key: string]: any;
}
and the following method:
export class BasketService {
addFile(file: File ) { //Some code here }
}
Now, when I invoke my method like this:
this._basketService.addFile({
id: file.id,
displayname: file.originalEntry['displayname'],
filesize: file.originalEntry['filesize'],
isarchived: file.originalEntry['isarchived'],
userId: this._appSession.user.id,
???: file.originalEntry // <=== How can I set the key value pair here?
});
The object:
file.originalEntry is [key: string]
. Instead of passing individual key/value pairs,
I want to pass the entire object.