-
-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Labels
Description
I'm submitting a feature request
- Language: TypeScript
Current behavior:
There is not an easy way to enforce type consistency in the data model passed through the open function and where it is consumed in the dialog view model's activate and canActivate functions.
- What is the expected behavior?
Add a generic type parameter toopenfor typing themodel(currently themodelis simply of typeany). For example:
dialogService.open<Customer>({
viewModel: Dialog,
model: {
// TypeScript compiler would throw an error if this object wasn't of type Customer
...- What is the motivation / use case for changing the behavior?
The consuming dialog view model would still need to manually type themodel, as one currently would, but at least there would be a little more security on the other end knowing that what's being passed in is actually of typeCustomer.
export class Dialog implements DialogComponentActivate<Customer> {
activate(model:Customer) {
...Reactions are currently unavailable