A UI-Router view has an Angular Component (see Ng2ViewDeclaration.component).
The Component may define component-level hooks which UI-Router will call at the appropriate times.
These callbacks are similar to Transition Hooks (IHookRegistry), but are only called if the view/component is currently active.
The uiOnParamsChanged callback is called when parameter values change.
This callback is used to respond dynamic parameter values changing.
It is called when a transition changed one or more dynamic parameter values,
and the routed component was not destroyed.
It receives two parameters:
An object with (only) changed parameter values.
The keys are the parameter names and the values are the new parameter values.
The Transition which changed the parameter values.
A UI-Router view has an Angular
Component
(see Ng2ViewDeclaration.component). TheComponent
may define component-level hooks which UI-Router will call at the appropriate times. These callbacks are similar to Transition Hooks (IHookRegistry), but are only called if the view/component is currently active.The uiOnParamsChanged callback is called when parameter values change.
This callback is used to respond dynamic parameter values changing. It is called when a transition changed one or more dynamic parameter values, and the routed component was not destroyed.
It receives two parameters:
Example:
@Component({ template: '<input type="text">' }) class MyComponent { uiOnParamsChanged(newParams: { [paramName: string]: any }, trans: Transition) { Object.keys(newParams).forEach(paramName => { console.log(`${paramName} changed to ${newParams[paramName]}`) }); } }