Interface IViewModelDefaults

Index

Properties

Methods

Properties

public closeOnDeactivate: boolean

default is true

Methods

public afterDeactivate(): any

called after deactivating a module

Returns

any

public areSameItem(currentItem: any, newItem: any, activationData: any): boolean

When the activator attempts to activate an item as described below, it will only activate the new item, by default, if it is a different instance than the current. Overwrite this function to change that behavior.

Parameters

  • currentItem: any
  • newItem: any
  • activationData: any

Returns

boolean

public beforeActivate(newItem: any): any

called before activating a module

Parameters

  • newItem: any

Returns

any

public interpretResponse(value: any): boolean

Interprets values returned from guard methods like canActivate and canDeactivate by transforming them into bools. The default implementation translates string values "Yes" and "Ok" as true...and all other string values as false. Non string values evaluate according to the truthy/falsey values of JavaScript. Replace this function with your own to expand or set up different values. This transformation is used by the activator internally and allows it to work smoothly in the common scenario where a deactivated item needs to show a message box to prompt the user before closing. Since the message box returns a promise that resolves to the button option the user selected, it can be automatically processed as part of the activator's guard check.

Parameters

  • value: any

Returns

boolean