Skip to content

Commit 6d41c31

Browse files
docs(Transition): Add example for addResolvable
1 parent 7078216 commit 6d41c31

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/transition/transition.ts

+11
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,17 @@ export class Transition implements IHookRegistry {
368368
/**
369369
* Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition.
370370
*
371+
* #### Example:
372+
* ```js
373+
* transitionService.onBefore({}, transition => {
374+
* transition.addResolvable({
375+
* token: 'myResolve',
376+
* deps: ['MyService'],
377+
* resolveFn: myService => myService.getData()
378+
* });
379+
* });
380+
* ```
381+
*
371382
* @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]])
372383
* @param state the state in the "to path" which should receive the new resolve (otherwise, the root state)
373384
*/

0 commit comments

Comments
 (0)