I am facing an issue when trying to limit input to an object, but unfortunately, it is not working correctly:
displayModal<T extends {[key: string]: any}, U>(component: Type<AbstractDialogComponent<T, U>>,
options?: ModalDialogOptions & { context: T }): Observable<U> {
options = { context: {}, viewContainerRef: this.vcRef,
fullscreen: true , ...options || {} };
return Observable.fromPromise(this.modal.displayModal(component, options));
}
An error message indicates:
Type '{}' is not assignable to type T
on the second line.
I need some assistance in resolving this issue. What am I overlooking?