You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/stateDirectives.js
+12-1
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,11 @@ function stateContext(el) {
41
41
* using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,
42
42
* and `reload`.
43
43
*
44
+
* You can invoke an expression when this state transition is initiated using
45
+
* the `ui-sref-on` attribute. The promise returned by {@link
46
+
* ui.router.state.$state#methods_go $state.go()} is injected into the expression as
47
+
* `$template`.
48
+
*
44
49
* @example
45
50
* Here's an example of how you'd use ui-sref and how it would compile. If you have the
46
51
* following template:
@@ -75,6 +80,7 @@ function stateContext(el) {
75
80
*
76
81
* @param {string} ui-sref 'stateName' can be any valid absolute or relative state
77
82
* @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()}
83
+
* @param {expression} ui-sref-on expression to evaluate when transition starts. Result of {@link ui.router.state.$state#methods_go $state.go()} is injected as '$transition'
78
84
*/
79
85
$StateRefDirective.$inject=['$state','$timeout'];
80
86
function$StateRefDirective($state,$timeout){
@@ -134,7 +140,12 @@ function $StateRefDirective($state, $timeout) {
0 commit comments