forked from mmistakes/minimal-mistakes
-
Notifications
You must be signed in to change notification settings - Fork 27
/
ng1.ng1statedeclaration.html
2097 lines (2083 loc) · 125 KB
/
ng1.ng1statedeclaration.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
redirect_from: /docs/1.0.24/interfaces/ng1.ng1statedeclaration.html
---
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Ng1StateDeclaration | @uirouter/angularjs</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<link rel="stylesheet" href="../assets/css/uirouter.css">
<script src="../assets/js/modernizr.js"></script>
<script src="../assets/js/reset.js"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@uirouter/angularjs</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<!--
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
-->
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Internal UI-Router API</label>
<!--
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
-->
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@uirouter/angularjs</a>
</li>
<li>
<a href="../modules/ng1.html">ng1</a>
</li>
<li>
<a href="ng1.ng1statedeclaration.html">Ng1StateDeclaration</a>
</li>
</ul>
<h1>Interface Ng1StateDeclaration</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The StateDeclaration object is used to define a state or nested state.
It should be registered with the <a href="ng1.__uirouter_core_lib_state_stateregistry_.stateregistry.html">StateRegistry</a>.</p>
</div>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h4>Example:</h4>
</a>
<pre><code class="language-js"><span class="hljs-comment">// StateDeclaration object</span>
<span class="hljs-keyword">var</span> foldersState = {
<span class="hljs-attr">name</span>: <span class="hljs-string">'folders'</span>,
<span class="hljs-attr">url</span>: <span class="hljs-string">'/folders'</span>,
<span class="hljs-attr">resolve</span>: {
<span class="hljs-attr">allfolders</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">FolderService</span>) </span>{
<span class="hljs-keyword">return</span> FolderService.list();
}
},
<span class="hljs-attr">template</span>: <span class="hljs-string">"<ul><li ng-repeat='folder in allfolders'>{{folder.name}}</li></ul>"</span>,
<span class="hljs-attr">controller</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">allfolders, $scope</span>) </span>{
$scope.allfolders = allfolders;
}
}</code></pre>
<p>Since this interface extends <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>, any view declaration properties can be set directly
on the state declaration and they will be applied to the view with the name <code>$default</code>. For example:</p>
<pre><code class="language-js"><span class="hljs-keyword">var</span> state = {
<span class="hljs-attr">name</span>: <span class="hljs-string">'foo'</span>,
<span class="hljs-attr">url</span>: <span class="hljs-string">'/foo'</span>,
<span class="hljs-attr">template</span>: <span class="hljs-string">'<h1>foo</h1>'</span>,
<span class="hljs-attr">controller</span>: <span class="hljs-string">'FooController'</span>
}</code></pre>
<p>is simply syntactic sugar for:</p>
<pre><code class="language-js"><span class="hljs-keyword">var</span> state = {
<span class="hljs-attr">name</span>: <span class="hljs-string">'foo'</span>,
<span class="hljs-attr">url</span>: <span class="hljs-string">'/foo'</span>,
<span class="hljs-attr">views</span>: {
<span class="hljs-attr">$default</span>: {
<span class="hljs-attr">template</span>: <span class="hljs-string">'<h1>foo</h1>'</span>,
<span class="hljs-attr">controller</span>: <span class="hljs-string">'FooController'</span>
}
}
}</code></pre>
<p>If a state definition contains a <code>views:</code> object, any view properties set directly on the state are ignored.
Thus, this is an invalid state defintion:</p>
<pre><code class="language-js"><span class="hljs-keyword">var</span> state = {
<span class="hljs-attr">name</span>: <span class="hljs-string">'foo'</span>,
<span class="hljs-attr">url</span>: <span class="hljs-string">'/foo'</span>,
<span class="hljs-attr">controller</span>: <span class="hljs-string">'FooController'</span>, <span class="hljs-comment">// invalid because views: exists</span>
<span class="hljs-attr">views</span>: {
<span class="hljs-attr">header</span>: {
<span class="hljs-attr">template</span>: <span class="hljs-string">'<h1>header</h1>'</span>
}
}
}</code></pre>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="ng1._ng1statedeclaration.html" class="tsd-signature-type">_Ng1StateDeclaration</a>
</li>
<li>
<a href="ng1.ng1viewdeclaration.html" class="tsd-signature-type">Ng1ViewDeclaration</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">Ng1StateDeclaration</span>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#__state" class="tsd-kind-icon">$$state</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="ng1.ng1statedeclaration.html#_context" class="tsd-kind-icon">$context</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="ng1.ng1statedeclaration.html#_name" class="tsd-kind-icon">$name</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="ng1.ng1statedeclaration.html#_type" class="tsd-kind-icon">$type</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="ng1.ng1statedeclaration.html#_uiviewcontextanchor" class="tsd-kind-icon">$ui<wbr>View<wbr>Context<wbr>Anchor</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="ng1.ng1statedeclaration.html#_uiviewname" class="tsd-kind-icon">$ui<wbr>View<wbr>Name</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#abstract" class="tsd-kind-icon">abstract</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#bindings" class="tsd-kind-icon">bindings</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#component" class="tsd-kind-icon">component</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#componentprovider" class="tsd-kind-icon">component<wbr>Provider</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#controller" class="tsd-kind-icon">controller</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#controlleras" class="tsd-kind-icon">controller<wbr>As</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#controllerprovider" class="tsd-kind-icon">controller<wbr>Provider</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#data" class="tsd-kind-icon">data</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#dynamic" class="tsd-kind-icon">dynamic</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#lazyload" class="tsd-kind-icon">lazy<wbr>Load</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#name" class="tsd-kind-icon">name</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-overwrite"><a href="ng1.ng1statedeclaration.html#onenter" class="tsd-kind-icon">on<wbr>Enter</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-overwrite"><a href="ng1.ng1statedeclaration.html#onexit" class="tsd-kind-icon">on<wbr>Exit</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-overwrite"><a href="ng1.ng1statedeclaration.html#onretain" class="tsd-kind-icon">on<wbr>Retain</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#params" class="tsd-kind-icon">params</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#parent" class="tsd-kind-icon">parent</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#redirectto" class="tsd-kind-icon">redirect<wbr>To</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-overwrite"><a href="ng1.ng1statedeclaration.html#reloadonsearch" class="tsd-kind-icon">reload<wbr>OnSearch</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#resolve" class="tsd-kind-icon">resolve</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#resolveas" class="tsd-kind-icon">resolve<wbr>As</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#resolvepolicy" class="tsd-kind-icon">resolve<wbr>Policy</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#template" class="tsd-kind-icon">template</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#templateprovider" class="tsd-kind-icon">template<wbr>Provider</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#templateurl" class="tsd-kind-icon">template<wbr>Url</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="ng1.ng1statedeclaration.html#url" class="tsd-kind-icon">url</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-overwrite"><a href="ng1.ng1statedeclaration.html#views" class="tsd-kind-icon">views</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="__state" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> $$state</h3>
-->
<div class="tsd-signature tsd-kind-icon">$$state<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span> <div class="tsd-header">
<p> Gets the internal State object API </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Gets the internal State object API</p>
</div>
<p>Gets the <em>internal API</em> for a registered state.</p>
<p>Note: the internal <a href="../classes/state.stateobject.html">StateObject</a> API is subject to change without notice</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">StateObject</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">StateObject</span></h4>
</div>
</li>
</ul>
</li>
</ul>
</div>
<aside class="tsd-sources">
<p>Inherited from StateDeclaration.$$state</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:154</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external">
<a name="_context" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> $context</h3>
-->
<div class="tsd-signature tsd-kind-icon">$context<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ViewContext</span> <div class="tsd-header">
<p> The context that this view is declared within. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The context that this view is declared within.</p>
</div>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from _ViewDeclaration.$context</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:68</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external">
<a name="_name" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> $name</h3>
-->
<div class="tsd-signature tsd-kind-icon">$name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <div class="tsd-header">
<p> The raw name for the view declaration, i.e., the <a href="state.statedeclaration.html#views">StateDeclaration.views</a> property name. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The raw name for the view declaration, i.e., the <a href="state.statedeclaration.html#views">StateDeclaration.views</a> property name.</p>
</div>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from _ViewDeclaration.$name</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:36</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external">
<a name="_type" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> $type</h3>
-->
<div class="tsd-signature tsd-kind-icon">$type<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <div class="tsd-header">
<p> A type identifier for the View </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A type identifier for the View</p>
</div>
<p>This is used when loading prerequisites for the view, before it enters the DOM. Different types of views
may load differently (e.g., templateProvider+controllerProvider vs component class)</p>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from _ViewDeclaration.$type</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:63</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external">
<a name="_uiviewcontextanchor" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> $ui<wbr>View<wbr>Context<wbr>Anchor</h3>
-->
<div class="tsd-signature tsd-kind-icon">$ui<wbr>View<wbr>Context<wbr>Anchor<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <div class="tsd-header">
<p> The normalized context anchor (state name) for the <code>uiViewName</code> </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The normalized context anchor (state name) for the <code>uiViewName</code></p>
</div>
<p>When targeting a <code>ui-view</code>, the <code>uiViewName</code> address is anchored to a context name (state name).</p>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from _ViewDeclaration.$uiViewContextAnchor</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:55</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external">
<a name="_uiviewname" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> $ui<wbr>View<wbr>Name</h3>
-->
<div class="tsd-signature tsd-kind-icon">$ui<wbr>View<wbr>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <div class="tsd-header">
<p> The normalized address for the <code>ui-view</code> which this ViewConfig targets. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The normalized address for the <code>ui-view</code> which this ViewConfig targets.</p>
</div>
<p>A ViewConfig targets a <code>ui-view</code> in the DOM (relative to the <code>uiViewContextAnchor</code>) which has
a specific name.</p>
<dl class="tsd-comment-tags">
<dt>example</dt>
<dd><p><code>header</code> or <code>$default</code></p>
<p>The <code>uiViewName</code> can also target a <em>nested view</em> by providing a dot-notation address</p>
</dd>
<dt>example</dt>
<dd><p><code>foo.bar</code> or <code>foo.$default.bar</code></p>
</dd>
</dl>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from _ViewDeclaration.$uiViewName</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:48</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="abstract" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> abstract</h3>
-->
<div class="tsd-signature tsd-kind-icon">abstract<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span> <div class="tsd-header">
<p> Abstract state indicator </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Abstract state indicator</p>
</div>
<p>An abstract state can never be directly activated.
Use an abstract state to provide inherited properties (url, resolve, data, etc) to children states.</p>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from StateDeclaration.abstract</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:121</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="bindings" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> bindings</h3>
-->
<div class="tsd-signature tsd-kind-icon">bindings<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span> <div class="tsd-header">
<p> An object which maps <code>resolve</code>s to <a href="ng1.ng1statedeclaration.html#component">component</a> <code>bindings</code>. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>An object which maps <code>resolve</code>s to <a href="ng1.ng1statedeclaration.html#component">component</a> <code>bindings</code>.</p>
</div>
<p>A property of <a href="ng1.ng1statedeclaration.html">Ng1StateDeclaration</a> or <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>:</p>
<p>When using a <a href="ng1.ng1statedeclaration.html#component">component</a> declaration (<code>component: 'myComponent'</code>), each input binding for the component is supplied
data from a resolve of the same name, by default. You may supply data from a different resolve name by mapping it here.</p>
<p>Each key in this object is the name of one of the component's input bindings.
Each value is the name of the resolve that should be provided to that binding.</p>
<p>Any component bindings that are omitted from this map get the default behavior of mapping to a resolve of the
same name.</p>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h4>Example:</h4>
</a>
<pre><code class="language-js">$stateProvider.state(<span class="hljs-string">'foo'</span>, {
<span class="hljs-attr">resolve</span>: {
<span class="hljs-attr">foo</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">FooService</span>) </span>{ <span class="hljs-keyword">return</span> FooService.get(); },
<span class="hljs-attr">bar</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">BarService</span>) </span>{ <span class="hljs-keyword">return</span> BarService.get(); }
},
<span class="hljs-attr">component</span>: <span class="hljs-string">'Baz'</span>,
<span class="hljs-comment">// The component's `baz` binding gets data from the `bar` resolve</span>
<span class="hljs-comment">// The component's `foo` binding gets data from the `foo` resolve (default behavior)</span>
<span class="hljs-attr">bindings</span>: {
<span class="hljs-attr">baz</span>: <span class="hljs-string">'bar'</span>
}
});
app.component(<span class="hljs-string">'Baz'</span>, {
<span class="hljs-attr">templateUrl</span>: <span class="hljs-string">'baz.html'</span>,
<span class="hljs-attr">controller</span>: <span class="hljs-string">'BazController'</span>,
<span class="hljs-attr">bindings</span>: {
<span class="hljs-attr">foo</span>: <span class="hljs-string">'<'</span>, <span class="hljs-comment">// foo binding</span>
<span class="hljs-attr">baz</span>: <span class="hljs-string">'<'</span> <span class="hljs-comment">// baz binding</span>
}
});</code></pre>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-index-signature">
<h5><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</div>
<aside class="tsd-sources">
<p>Inherited from <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>.<a href="ng1.ng1viewdeclaration.html#bindings">bindings</a></p>
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-angularjs/src/interface.ts:464</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="component" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> component</h3>
-->
<div class="tsd-signature tsd-kind-icon">component<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <div class="tsd-header">
<p> The name of the component to use for this view. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The name of the component to use for this view.</p>
</div>
<p>A property of <a href="ng1.ng1statedeclaration.html">Ng1StateDeclaration</a> or <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>:</p>
<p>The name of an <a href="https://docs.angularjs.org/guide/component">angular 1.5+ <code>.component()</code></a> (or directive with
bindToController and/or scope declaration) which will be used for this view.</p>
<p>Resolve data can be provided to the component via the component's <code>bindings</code> object (for 1.3+ directives, the
<code>bindToController</code> is used; for other directives, the <code>scope</code> declaration is used). For each binding declared
on the component, any resolve with the same name is set on the component's controller instance. The binding
is provided to the component as a one-time-binding. In general, components should likewise declare their
input bindings as <a href="https://docs.angularjs.org/api/ng/service/$compile#-scope-">one-way ("<")</a>.</p>
<p>Note: inside a "views:" block, a bare string <code>"foo"</code> is shorthand for <code>{ component: "foo" }</code></p>
<p>Note: Mapping from resolve names to component inputs may be specified using <a href="ng1.ng1statedeclaration.html#bindings">bindings</a>.</p>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h4>Example:</h4>
</a>
<pre><code class="language-js">.state(<span class="hljs-string">'profile'</span>, {
<span class="hljs-comment">// Use the <my-profile></my-profile> component for the Unnamed view</span>
<span class="hljs-attr">component</span>: <span class="hljs-string">'MyProfile'</span>,
}
.state(<span class="hljs-string">'messages'</span>, {
<span class="hljs-comment">// use the <nav-bar></nav-bar> component for the view named 'header'</span>
<span class="hljs-comment">// use the <message-list></message-list> component for the view named 'content'</span>
<span class="hljs-attr">views</span>: {
<span class="hljs-attr">header</span>: { <span class="hljs-attr">component</span>: <span class="hljs-string">'NavBar'</span> },
<span class="hljs-attr">content</span>: { <span class="hljs-attr">component</span>: <span class="hljs-string">'MessageList'</span> }
}
}
.state(<span class="hljs-string">'contacts'</span>, {
<span class="hljs-comment">// Inside a "views:" block, a bare string "NavBar" is shorthand for { component: "NavBar" }</span>
<span class="hljs-comment">// use the <nav-bar></nav-bar> component for the view named 'header'</span>
<span class="hljs-comment">// use the <contact-list></contact-list> component for the view named 'content'</span>
<span class="hljs-attr">views</span>: {
<span class="hljs-attr">header</span>: <span class="hljs-string">'NavBar'</span>,
<span class="hljs-attr">content</span>: <span class="hljs-string">'ContactList'</span>
}
}</code></pre>
<p>Note: When using <code>component</code> to define a view, you may <em>not</em> use any of: <code>template</code>, <code>templateUrl</code>,
<code>templateProvider</code>, <code>controller</code>, <code>controllerProvider</code>, <code>controllerAs</code>.</p>
<p>See also: Todd Motto's angular 1.3 and 1.4 <a href="https://github.com/toddmotto/angular-component">backport of .component()</a></p>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>.<a href="ng1.ng1viewdeclaration.html#component">component</a></p>
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-angularjs/src/interface.ts:422</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="componentprovider" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> component<wbr>Provider</h3>
-->
<div class="tsd-signature tsd-kind-icon">component<wbr>Provider<span class="tsd-signature-symbol">:</span> <a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a> <div class="tsd-header">
<p> Dynamic component provider function. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Dynamic component provider function.</p>
</div>
<p>A property of <a href="ng1.ng1statedeclaration.html">Ng1StateDeclaration</a> or <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>:</p>
<p>This is an injectable provider function which returns the name of the component to use.
The provider will invoked during a Transition in which the view's state is entered.
The provider is called after the resolve data is fetched.</p>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h4>Example:</h4>
</a>
<pre><code class="language-js">componentProvider: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">MyResolveData, $transition$</span>) </span>{
<span class="hljs-keyword">if</span> (MyResolveData.foo) {
<span class="hljs-keyword">return</span> <span class="hljs-string">"fooComponent"</span>
} <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> ($transition$.to().name === <span class="hljs-string">'bar'</span>) {
<span class="hljs-keyword">return</span> <span class="hljs-string">"barComponent"</span>;
}
}</code></pre>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>.<a href="ng1.ng1viewdeclaration.html#componentprovider">componentProvider</a></p>
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-angularjs/src/interface.ts:486</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="controller" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> controller</h3>
-->
<div class="tsd-signature tsd-kind-icon">controller<span class="tsd-signature-symbol">:</span> <a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span> <div class="tsd-header">
<p> The view's controller function or name </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The view's controller function or name</p>
</div>
<p>A property of <a href="ng1.ng1statedeclaration.html">Ng1StateDeclaration</a> or <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>:</p>
<p>The controller function, or the name of a registered controller. The controller function will be used
to control the contents of the <a href="../modules/directives.html#uiview">directives.uiView</a> directive.</p>
<p>If specified as a string, controllerAs can be declared here, i.e., "FooController as foo" instead of in
a separate <a href="ng1.ng1statedeclaration.html#controlleras">controllerAs</a> property.</p>
<p>See: <a href="ng1.ng1controller.html">Ng1Controller</a> for information about component-level router hooks.</p>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>.<a href="ng1.ng1viewdeclaration.html#controller">controller</a></p>
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-angularjs/src/interface.ts:501</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="controlleras" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> controller<wbr>As</h3>
-->
<div class="tsd-signature tsd-kind-icon">controller<wbr>As<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <div class="tsd-header">
<p> A controller alias name. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A controller alias name.</p>
</div>
<p>A property of <a href="ng1.ng1statedeclaration.html">Ng1StateDeclaration</a> or <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>:</p>
<p>If present, the controller will be published to scope under the <code>controllerAs</code> name.
See: <a href="https://docs.angularjs.org/api/ng/directive/ngController">https://docs.angularjs.org/api/ng/directive/ngController</a></p>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>.<a href="ng1.ng1viewdeclaration.html#controlleras">controllerAs</a></p>
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-angularjs/src/interface.ts:511</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="controllerprovider" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> controller<wbr>Provider</h3>
-->
<div class="tsd-signature tsd-kind-icon">controller<wbr>Provider<span class="tsd-signature-symbol">:</span> <a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a> <div class="tsd-header">
<p> Dynamic controller provider function. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Dynamic controller provider function.</p>
</div>
<p>A property of <a href="ng1.ng1statedeclaration.html">Ng1StateDeclaration</a> or <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>:</p>
<p>This is an injectable provider function which returns the actual controller function, or the name
of a registered controller. The provider will invoked during a Transition in which the view's state is
entered. The provider is called after the resolve data is fetched.</p>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h4>Example:</h4>
</a>
<pre><code class="language-js">controllerProvider: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">MyResolveData, $transition$</span>) </span>{
<span class="hljs-keyword">if</span> (MyResolveData.foo) {
<span class="hljs-keyword">return</span> <span class="hljs-string">"FooCtrl"</span>
} <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> ($transition$.to().name === <span class="hljs-string">'bar'</span>) {
<span class="hljs-keyword">return</span> <span class="hljs-string">"BarCtrl"</span>;
} <span class="hljs-keyword">else</span> {
<span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">$scope</span>) </span>{
$scope.baz = <span class="hljs-string">"Qux"</span>;
}
}
}</code></pre>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from <a href="ng1.ng1viewdeclaration.html">Ng1ViewDeclaration</a>.<a href="ng1.ng1viewdeclaration.html#controllerprovider">controllerProvider</a></p>
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-angularjs/src/interface.ts:537</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="data" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> data</h3>
-->
<div class="tsd-signature tsd-kind-icon">data<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span> <div class="tsd-header">
<p> An inherited property to store state data </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>An inherited property to store state data</p>
</div>
<p>This is a spot for you to store inherited state metadata.
Child states' <code>data</code> object will prototypally inherit from their parent state.</p>
<p>This is a good spot to put metadata such as <code>requiresAuth</code>.</p>
<p>Note: because prototypal inheritance is used, changes to parent <code>data</code> objects reflect in the child <code>data</code> objects.
Care should be taken if you are using <code>hasOwnProperty</code> on the <code>data</code> object.
Properties from parent objects will return false for <code>hasOwnProperty</code>.</p>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from StateDeclaration.data</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:403</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="dynamic" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> dynamic</h3>
-->
<div class="tsd-signature tsd-kind-icon">dynamic<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span> <div class="tsd-header">
<p> Marks all the state's parameters as <code>dynamic</code>. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Marks all the state's parameters as <code>dynamic</code>.</p>
</div>
<p>All parameters on the state will use this value for <code>dynamic</code> as a default.
Individual parameters may override this default using <a href="params.paramdeclaration.html#dynamic">ParamDeclaration.dynamic</a> in the <a href="ng1.ng1statedeclaration.html#params">params</a> block.</p>
<p>Note: this value overrides the <code>dynamic</code> value on a custom parameter type (<a href="params.paramtypedefinition.html#dynamic">ParamTypeDefinition.dynamic</a>).</p>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from StateDeclaration.dynamic</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:667</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="lazyload" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> lazy<wbr>Load</h3>
-->
<div class="tsd-signature tsd-kind-icon">lazy<wbr>Load<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span> <div class="tsd-header">
<p> A function used to lazy load code </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A function used to lazy load code</p>
</div>
<p>The <code>lazyLoad</code> function is invoked before the state is activated.
The transition waits while the code is loading.</p>
<p>The function should load the code that is required to activate the state.
For example, it may load a component class, or some service code.
The function must return a promise which resolves when loading is complete.</p>
<p>For example, this code lazy loads a service before the <code>abc</code> state is activated:</p>
<pre><code>.<span class="hljs-keyword">state</span>('abc', {
lazyLoad: (transition, <span class="hljs-keyword">state</span>) => System.import('./abcService')
}</code></pre><p>The <code>abcService</code> file is imported and loaded
(it is assumed that the <code>abcService</code> file knows how to register itself as a service).</p>
<a href="#lifecycle" id="lifecycle" style="color: inherit; text-decoration: none;">
<h4>Lifecycle</h4>
</a>
<ul>
<li><p>The <code>lazyLoad</code> function is invoked if a transition is going to enter the state.</p>
</li>
<li><p>The function is invoked before the transition starts (using an <code>onBefore</code> transition hook).</p>
</li>
<li><p>The function is only invoked once; while the <code>lazyLoad</code> function is loading code, it will not be invoked again.
For example, if the user double clicks a ui-sref, <code>lazyLoad</code> is only invoked once even though there were two transition attempts.
Instead, the existing lazy load promise is re-used.</p>
</li>
<li><p>When the promise resolves successfully, the <code>lazyLoad</code> property is deleted from the state declaration.</p>
</li>
<li><p>If the promise resolves to a <a href="state.lazyloadresult.html">LazyLoadResult</a> which has an array of <code>states</code>, those states are registered.</p>
</li>
<li><p>The original transition is retried (this time without the <code>lazyLoad</code> property present).</p>
</li>
<li><p>If the <code>lazyLoad</code> function fails, then the transition also fails.
The failed transition (and the <code>lazyLoad</code> function) could potentially be retried by the user.</p>
</li>
</ul>
<a href="#lazy-loading-state-definitions-future-states" id="lazy-loading-state-definitions-future-states" style="color: inherit; text-decoration: none;">
<h3>Lazy loading state definitions (Future States)</h3>
</a>
<p>State definitions can also be lazy loaded.
This might be desirable when building large, multi-module applications.</p>
<p>To lazy load state definitions, a Future State should be registered as a placeholder.
When the state definitions are lazy loaded, the Future State is deregistered.</p>
<p>A future state can act as a placeholder for a single state, or for an entire module of states and substates.
A future state should have:</p>
<ul>
<li>A <code>name</code> which ends in <code>.**</code>.
A future state's <code>name</code> property acts as a wildcard <a href="../classes/core.glob.html">Glob</a>.
It matches any state name that starts with the <code>name</code> (including child states that are not yet loaded).</li>
<li>A <code>url</code> prefix.
A future state's <code>url</code> property acts as a wildcard.
UI-Router matches all paths that begin with the <code>url</code>.
It effectively appends <code>.*</code> to the internal regular expression.
When the prefix matches, the future state will begin loading.</li>
<li>A <code>lazyLoad</code> function.
This function should should return a Promise to lazy load the code for one or more <a href="state.statedeclaration.html">StateDeclaration</a> objects.
It should return a <a href="state.lazyloadresult.html">LazyLoadResult</a>.
Generally, one of the lazy loaded states should have the same name as the future state.
The new state will then <strong>replace the future state placeholder</strong> in the registry.</li>
</ul>
<a href="#additional-resources" id="additional-resources" style="color: inherit; text-decoration: none;">
<h3>Additional resources</h3>
</a>
<p>For in depth information on lazy loading and Future States, see the <a href="https://ui-router.github.io/guides/lazyload">Lazy Loading Guide</a>.</p>
<a href="#example-statesjs" id="example-statesjs" style="color: inherit; text-decoration: none;">
<h4>Example: states.js</h4>
</a>
<pre><code class="language-js">
<span class="hljs-comment">// This child state is a lazy loaded future state</span>
<span class="hljs-comment">// The `lazyLoad` function loads the final state definition</span>
{
<span class="hljs-attr">name</span>: <span class="hljs-string">'parent.**'</span>,
<span class="hljs-attr">url</span>: <span class="hljs-string">'/parent'</span>,
<span class="hljs-attr">lazyLoad</span>: <span class="hljs-function"><span class="hljs-params">()</span> =></span> System.import(<span class="hljs-string">'./lazy.states.js'</span>)
}</code></pre>
<a href="#example-lazystatesjs" id="example-lazystatesjs" style="color: inherit; text-decoration: none;">
<h4>Example: lazy.states.js</h4>
</a>
<p>This file is lazy loaded. It exports an array of states.</p>
<pre><code class="language-js"><span class="hljs-keyword">import</span> {ChildComponent} <span class="hljs-keyword">from</span> <span class="hljs-string">"./child.component.js"</span>;
<span class="hljs-keyword">import</span> {ParentComponent} <span class="hljs-keyword">from</span> <span class="hljs-string">"./parent.component.js"</span>;
<span class="hljs-comment">// This fully defined state replaces the future state</span>
<span class="hljs-keyword">let</span> parentState = {
<span class="hljs-comment">// the name should match the future state</span>
<span class="hljs-attr">name</span>: <span class="hljs-string">'parent'</span>,
<span class="hljs-attr">url</span>: <span class="hljs-string">'/parent/:parentId'</span>,
<span class="hljs-attr">component</span>: ParentComponent,
<span class="hljs-attr">resolve</span>: {
<span class="hljs-attr">parentData</span>: <span class="hljs-function">(<span class="hljs-params">$transition$, ParentService</span>) =></span>
ParentService.get($transition$.params().parentId)
}
}
<span class="hljs-keyword">let</span> childState = {
<span class="hljs-attr">name</span>: <span class="hljs-string">'parent.child'</span>,
<span class="hljs-attr">url</span>: <span class="hljs-string">'/child/:childId'</span>,
<span class="hljs-attr">params</span>: {
<span class="hljs-attr">childId</span>: <span class="hljs-string">"default"</span>
},
<span class="hljs-attr">resolve</span>: {
<span class="hljs-attr">childData</span>: <span class="hljs-function">(<span class="hljs-params">$transition$, ChildService</span>) =></span>
ChildService.get($transition$.params().childId)
}
};
<span class="hljs-comment">// This array of states will be registered by the lazyLoad hook</span>
<span class="hljs-keyword">let</span> lazyLoadResults = {
<span class="hljs-attr">states</span>: [ parentState, childState ]
};
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> lazyLoadResults;</code></pre>
<dl class="tsd-comment-tags">
<dt>param</dt>
<dd><p>the <a href="../classes/transition.transition-1.html">Transition</a> that is activating the future state</p>
</dd>
<dt>param</dt>
<dd><p>the <a href="state.statedeclaration.html">StateDeclaration</a> that the <code>lazyLoad</code> function is declared on</p>
</dd>
<dt>returns</dt>
<dd><p>a Promise to load the states.
Optionally, if the promise resolves to a <a href="state.lazyloadresult.html">LazyLoadResult</a>,
the states will be registered with the <a href="ng1.__uirouter_core_lib_state_stateregistry_.stateregistry.html">StateRegistry</a>.</p>
</dd>
</dl>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter-siganture">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>transition<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Transition</span>, state<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">StateDeclaration</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">LazyLoadResult</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>transition <span class="tsd-signature-type">Transition</span></h5>
</li>
<li>
<h5>state <span class="tsd-signature-type">StateDeclaration</span></h5>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">LazyLoadResult</span><span class="tsd-signature-symbol">></span></h4>
</div>
</li>
</ul>
</li>
</ul>
</div>
<aside class="tsd-sources">
<p>Inherited from StateDeclaration.lazyLoad</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:658</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
<a name="name" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> name</h3>
-->
<div class="tsd-signature tsd-kind-icon">name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <div class="tsd-header">
<p> The state name (required) </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The state name (required)</p>
</div>
<p>A unique state name, e.g. <code>"home"</code>, <code>"about"</code>, <code>"contacts"</code>.
To create a parent/child state use a dot, e.g. <code>"about.sales"</code>, <code>"home.newest"</code>.</p>
<p>Note: [State] objects require unique names.
The name is used like an id.</p>
</div>
</div>
<aside class="tsd-sources">
<p>Inherited from StateDeclaration.name</p>
<ul>
<li>Defined in Users/cthielen/projects/uirouter/angularjs/node_modules/@uirouter/core/lib/state/interface.d.ts:114</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-overwrite">
<a name="onenter" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> on<wbr>Enter</h3>
-->
<div class="tsd-signature tsd-kind-icon">on<wbr>Enter<span class="tsd-signature-symbol">:</span> <a href="ng1.ng1statetransitionhook.html" class="tsd-signature-type">Ng1StateTransitionHook</a><span class="tsd-signature-symbol"> | </span><a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a> <div class="tsd-header">
<p> A state hook invoked when a state is being entered. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A state hook invoked when a state is being entered.</p>
</div>
<p>The hook can inject global services.
It can also inject <code>$transition$</code> or <code>$state$</code> (from the current transition).</p>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h3>Example:</h3>
</a>
<pre><code class="language-js">$stateProvider.state({
<span class="hljs-attr">name</span>: <span class="hljs-string">'mystate'</span>,
<span class="hljs-attr">onEnter</span>: <span class="hljs-function">(<span class="hljs-params">MyService, $transition$, $state$</span>) =></span> {
<span class="hljs-keyword">return</span> MyService.doSomething($state$.name, $transition$.params());
}
});</code></pre>
<a href="#example-1" id="example-1" style="color: inherit; text-decoration: none;">
<h4>Example:`</h4>
</a>
<pre><code class="language-js">$stateProvider.state({
<span class="hljs-attr">name</span>: <span class="hljs-string">'mystate'</span>,
<span class="hljs-attr">onEnter</span>: [ <span class="hljs-string">'MyService'</span>, <span class="hljs-string">'$transition$'</span>, <span class="hljs-string">'$state$'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">MyService, $transition$, $state$</span>) </span>{
<span class="hljs-keyword">return</span> MyService.doSomething($state$.name, $transition$.params());
} ]
});</code></pre>
</div>
</div>
<aside class="tsd-sources">
<p>Overwrites <a href="ng1._ng1statedeclaration.html">_Ng1StateDeclaration</a>.<a href="ng1._ng1statedeclaration.html#onenter">onEnter</a></p>
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-angularjs/src/interface.ts:301</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-overwrite">
<a name="onexit" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> on<wbr>Exit</h3>
-->
<div class="tsd-signature tsd-kind-icon">on<wbr>Exit<span class="tsd-signature-symbol">:</span> <a href="ng1.ng1statetransitionhook.html" class="tsd-signature-type">Ng1StateTransitionHook</a><span class="tsd-signature-symbol"> | </span><a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a> <div class="tsd-header">
<p> A state hook invoked when a state is being exited. </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A state hook invoked when a state is being exited.</p>
</div>
<p>The hook can inject global services.
It can also inject <code>$transition$</code> or <code>$state$</code> (from the current transition).</p>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h3>Example:</h3>
</a>
<pre><code class="language-js">$stateProvider.state({
<span class="hljs-attr">name</span>: <span class="hljs-string">'mystate'</span>,
<span class="hljs-attr">onExit</span>: <span class="hljs-function">(<span class="hljs-params">MyService, $transition$, $state$</span>) =></span> {
<span class="hljs-keyword">return</span> MyService.doSomething($state$.name, $transition$.params());
}
});</code></pre>
<a href="#example-1" id="example-1" style="color: inherit; text-decoration: none;">
<h4>Example:`</h4>
</a>
<pre><code class="language-js">$stateProvider.state({
<span class="hljs-attr">name</span>: <span class="hljs-string">'mystate'</span>,
<span class="hljs-attr">onExit</span>: [ <span class="hljs-string">'MyService'</span>, <span class="hljs-string">'$transition$'</span>, <span class="hljs-string">'$state$'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">MyService, $transition$, $state$</span>) </span>{
<span class="hljs-keyword">return</span> MyService.doSomething($state$.name, $transition$.params());
} ]
});</code></pre>
</div>
</div>
<aside class="tsd-sources">
<p>Overwrites <a href="ng1._ng1statedeclaration.html">_Ng1StateDeclaration</a>.<a href="ng1._ng1statedeclaration.html#onexit">onExit</a></p>
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-angularjs/src/interface.ts:329</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-overwrite">
<a name="onretain" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> on<wbr>Retain</h3>
-->
<div class="tsd-signature tsd-kind-icon">on<wbr>Retain<span class="tsd-signature-symbol">:</span> <a href="ng1.ng1statetransitionhook.html" class="tsd-signature-type">Ng1StateTransitionHook</a><span class="tsd-signature-symbol"> | </span><a href="../modules/common.html#iinjectable" class="tsd-signature-type">IInjectable</a> <div class="tsd-header">
<p> A state hook invoked when a state is being retained. </p>
</div>
</div>