@@ -139,6 +139,7 @@ <h3>Methods</h3>
139
139
< li class ="tsd-kind-method tsd-parent-kind-class "> < a href ="view.viewservice.html#deactivateviewconfig " class ="tsd-kind-icon "> deactivate< wbr > View< wbr > Config</ a > </ li >
140
140
< li class ="tsd-kind-method tsd-parent-kind-class "> < a href ="view.viewservice.html#registeruiview " class ="tsd-kind-icon "> registerUIView</ a > </ li >
141
141
< li class ="tsd-kind-method tsd-parent-kind-class "> < a href ="view.viewservice.html#sync " class ="tsd-kind-icon "> sync</ a > </ li >
142
+ < li class ="tsd-kind-method tsd-parent-kind-class tsd-is-static tsd-is-external "> < a href ="view.viewservice.html#matches " class ="tsd-kind-icon "> matches</ a > </ li >
142
143
< li class ="tsd-kind-method tsd-parent-kind-class tsd-is-static "> < a href ="view.viewservice.html#normalizeuiviewtarget " class ="tsd-kind-icon "> normalizeUIView< wbr > Target</ a > </ li >
143
144
</ ul >
144
145
</ section >
@@ -498,7 +499,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">(Anonymou
498
499
< hr >
499
500
< aside class ="tsd-sources ">
500
501
< ul >
501
- < li > Defined in < a href ="https://github.com/ui-router/core/blob/48c5af6/src/view/view.ts#L219 "> ui-router-core/src/view/view.ts:219 </ a > </ li >
502
+ < li > Defined in < a href ="https://github.com/ui-router/core/blob/48c5af6/src/view/view.ts#L221 "> ui-router-core/src/view/view.ts:221 </ a > </ li >
502
503
</ ul >
503
504
</ aside > </ li >
504
505
</ ul >
@@ -519,7 +520,98 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
519
520
< hr >
520
521
< aside class ="tsd-sources ">
521
522
< ul >
522
- < li > Defined in < a href ="https://github.com/ui-router/core/blob/48c5af6/src/view/view.ts#L87 "> ui-router-core/src/view/view.ts:87</ a > </ li >
523
+ < li > Defined in < a href ="https://github.com/ui-router/core/blob/48c5af6/src/view/view.ts#L166 "> ui-router-core/src/view/view.ts:166</ a > </ li >
524
+ </ ul >
525
+ </ aside > </ li >
526
+ </ ul >
527
+ </ section >
528
+ < section class ="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static tsd-is-external ">
529
+ < a name ="matches " class ="tsd-anchor "> </ a >
530
+ <!--
531
+ <h3><span class="tsd-flag ts-flagStatic">Static</span> matches</h3>
532
+ -->
533
+ < ul class ="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static tsd-is-external ">
534
+ < li class ="tsd-signature tsd-kind-icon "> matches< span class ="tsd-signature-symbol "> (</ span > uiViewsByFqn< span class ="tsd-signature-symbol "> : </ span > < a href ="../interfaces/common.typedmap.html " class ="tsd-signature-type "> TypedMap</ a > < span class ="tsd-signature-symbol "> <</ span > < a href ="../interfaces/view.activeuiview.html " class ="tsd-signature-type "> ActiveUIView</ a > < span class ="tsd-signature-symbol "> ></ span > , uiView< span class ="tsd-signature-symbol "> : </ span > < a href ="../interfaces/view.activeuiview.html " class ="tsd-signature-type "> ActiveUIView</ a > < span class ="tsd-signature-symbol "> )</ span > < span class ="tsd-signature-symbol "> : </ span > < span class ="tsd-signature-type "> (Anonymous function)</ span > </ li >
535
+ < li class ="tsd-header ">
536
+ < p > Given a ui-view and a ViewConfig, determines if they "match". </ p >
537
+ </ li >
538
+ </ ul >
539
+ < ul class ="tsd-descriptions ">
540
+ < li class ="tsd-description ">
541
+ < div class ="tsd-comment tsd-typography ">
542
+ < div class ="lead ">
543
+ < p > Given a ui-view and a ViewConfig, determines if they "match".</ p >
544
+ </ div >
545
+ < p > A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in
546
+ the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of.</ p >
547
+ < p > A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or
548
+ can be a segmented ui-view path, describing a portion of a ui-view fqn.</ p >
549
+ < p > In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type</ p >
550
+ < p > If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if:</ p >
551
+ < ul >
552
+ < li > the ui-view's name matches the ViewConfig's target name</ li >
553
+ < li > the ui-view's context matches the ViewConfig's anchor</ li >
554
+ </ ul >
555
+ < p > If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if:</ p >
556
+ < ul >
557
+ < li > There exists a parent ui-view where:< ul >
558
+ < li > the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name</ li >
559
+ < li > the parent ui-view's context matches the ViewConfig's anchor</ li >
560
+ </ ul >
561
+ </ li >
562
+ < li > And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn</ li >
563
+ </ ul >
564
+ < p > Example:</ p >
565
+ < p > DOM:</ p >
566
+ < p > < ui-view > <!-- created in the root context (name: "") -->
567
+ < ui-view name ="foo "> <!-- created in the context named: "A" -->
568
+ < ui-view > <!-- created in the context named: "A.B" -->
569
+ < ui-view name ="bar "> <!-- created in the context named: "A.B.C" -->
570
+ </ ui-view >
571
+ </ ui-view >
572
+ </ ui-view >
573
+ </ ui-view > </ p >
574
+ < p > uiViews: [
575
+ { fqn: "$default", creationContext: { name: "" } },
576
+ { fqn: "$default.foo", creationContext: { name: "A" } },
577
+ { fqn: "$default.foo.$default", creationContext: { name: "A.B" } }
578
+ { fqn: "$default.foo.$default.bar", creationContext: { name: "A.B.C" } }
579
+ ]</ p >
580
+ < p > These four view configs all match the ui-view with the fqn: "$default.foo.$default.bar":</ p >
581
+ < ul >
582
+ < li > ViewConfig1: { uiViewName: "bar", uiViewContextAnchor: "A.B.C" }</ li >
583
+ < li > ViewConfig2: { uiViewName: "$default.bar", uiViewContextAnchor: "A.B" }</ li >
584
+ < li > ViewConfig3: { uiViewName: "foo.$default.bar", uiViewContextAnchor: "A" }</ li >
585
+ < li > ViewConfig4: { uiViewName: "$default.foo.$default.bar", uiViewContextAnchor: "" }</ li >
586
+ </ ul >
587
+ < p > Using ViewConfig3 as an example, it matches the ui-view with fqn "$default.foo.$default.bar" because:</ p >
588
+ < ul >
589
+ < li > The ViewConfig's segmented target name is: [ "foo", "$default", "bar" ]</ li >
590
+ < li > There exists a parent ui-view (which has fqn: "$default.foo") where:< ul >
591
+ < li > the parent ui-view's name "foo" matches the first segment "foo" of the ViewConfig's target name</ li >
592
+ < li > the parent ui-view's context "A" matches the ViewConfig's anchor context "A"</ li >
593
+ </ ul >
594
+ </ li >
595
+ < li > And the remaining segments [ "$default", "bar" ].join("."_ of the ViewConfig's target name match
596
+ the tail of the ui-view's fqn "default.bar"</ li >
597
+ </ ul >
598
+ </ div >
599
+ < h4 class ="tsd-parameters-title "> Parameters</ h4 >
600
+ < ul class ="tsd-parameters ">
601
+ < li >
602
+ < h5 > uiViewsByFqn < a href ="../interfaces/common.typedmap.html " class ="tsd-signature-type "> TypedMap</ a > < span class ="tsd-signature-symbol "> <</ span > < a href ="../interfaces/view.activeuiview.html " class ="tsd-signature-type "> ActiveUIView</ a > < span class ="tsd-signature-symbol "> ></ span > </ h5 >
603
+ </ li >
604
+ < li >
605
+ < h5 > uiView < a href ="../interfaces/view.activeuiview.html " class ="tsd-signature-type "> ActiveUIView</ a > </ h5 >
606
+ </ li >
607
+ </ ul >
608
+ < div class ="tsd-returns ">
609
+ < h4 class ="tsd-returns-title "> Returns < span class ="tsd-signature-type "> (Anonymous function)</ span > </ h4 >
610
+ </ div >
611
+ < hr >
612
+ < aside class ="tsd-sources ">
613
+ < ul >
614
+ < li > Defined in < a href ="https://github.com/ui-router/core/blob/48c5af6/src/view/view.ts#L144 "> ui-router-core/src/view/view.ts:144</ a > </ li >
523
615
</ ul >
524
616
</ aside > </ li >
525
617
</ ul >
@@ -541,6 +633,8 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> normalizeUIView<wbr>Targe
541
633
< div class ="lead ">
542
634
< p > Normalizes a view's name from a state.views configuration block.</ p >
543
635
</ div >
636
+ < p > This should be used by a framework implementation to calculate the values for
637
+ < a href ="../interfaces/state._viewdeclaration.html#_uiviewname "> _ViewDeclaration.$uiViewName</ a > and < a href ="../interfaces/state._viewdeclaration.html#_uiviewcontextanchor "> _ViewDeclaration.$uiViewContextAnchor</ a > .</ p >
544
638
</ div >
545
639
< h4 class ="tsd-parameters-title "> Parameters</ h4 >
546
640
< ul class ="tsd-parameters ">
@@ -786,6 +880,9 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Array</sp
786
880
< li class =" tsd-kind-method tsd-parent-kind-class ">
787
881
< a href ="view.viewservice.html#sync " class ="tsd-kind-icon "> sync</ a >
788
882
</ li >
883
+ < li class =" tsd-kind-method tsd-parent-kind-class tsd-is-static tsd-is-external ">
884
+ < a href ="view.viewservice.html#matches " class ="tsd-kind-icon "> matches</ a >
885
+ </ li >
789
886
< li class =" tsd-kind-method tsd-parent-kind-class tsd-is-static ">
790
887
< a href ="view.viewservice.html#normalizeuiviewtarget " class ="tsd-kind-icon "> normalizeUIView< wbr > Target</ a >
791
888
</ li >
0 commit comments