File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,13 @@ export class UIView {
117
117
this . _parent = parent ;
118
118
}
119
119
120
+ /**
121
+ * @returns the UI-Router `state` that is filling this uiView, or `undefined`.
122
+ */
123
+ public get state ( ) : StateDeclaration {
124
+ return parse ( "_uiViewData.config.viewDecl.$context.self" ) ( this ) ;
125
+ }
126
+
120
127
ngOnInit ( ) {
121
128
const router = this . router ;
122
129
const parentFqn = this . _parent . fqn ;
@@ -149,7 +156,7 @@ export class UIView {
149
156
const uiCanExitFn : TransitionHookFn = instance && instance . uiCanExit ;
150
157
151
158
if ( isFunction ( uiCanExitFn ) ) {
152
- const state : StateDeclaration = parse ( "_uiViewData.config.viewDecl.$context.self" ) ( this ) ;
159
+ const state : StateDeclaration = this . state ;
153
160
154
161
if ( trans . exiting ( ) . indexOf ( state ) !== - 1 ) {
155
162
trans . onStart ( { } , function ( ) {
You can’t perform that action at this time.
0 commit comments