File tree Expand file tree Collapse file tree 1 file changed +37
-37
lines changed Expand file tree Collapse file tree 1 file changed +37
-37
lines changed Original file line number Diff line number Diff line change @@ -185,46 +185,46 @@ Another handy feature is the ability to have more than one view per template. Pl
185
185
3 . Set up your states in the module config:
186
186
>
187
187
``` javascript
188
- myapp .config (function ($stateProvider ){
189
- $stateProvider
190
- .state (' index' , {
191
- url: " " , // root route
192
- views: {
193
- " viewA" : {
194
- templateUrl : " index.viewA.html "
195
- },
196
- " viewB" : {
197
- templateUrl : " index.viewB.html "
198
- }
199
- }
200
- })
201
- .state (' route1' , {
202
- url: " /route1" ,
203
- views: {
204
- " viewA" : {
205
- templateUrl : " route1.viewA.html "
206
- },
207
- " viewB" : {
208
- templateUrl : " route1.viewB.html "
209
- }
210
- }
211
- })
212
- .state (' route2' , {
213
- url: " /route2" ,
214
- views: {
215
- " viewA" : {
216
- templateUrl : " route2.viewA.html "
217
- },
218
- " viewB" : {
219
- templateUrl : " route2.viewB.html "
220
- }
221
- }
222
- })
223
- })
188
+ myapp .config (function ($stateProvider , $routeProvider ){
189
+ $stateProvider
190
+ .state (' index' , {
191
+ url: " " ,
192
+ views: {
193
+ " viewA" : {
194
+ template : " index.viewA"
195
+ },
196
+ " viewB" : {
197
+ template : " index.viewB"
198
+ }
199
+ }
200
+ })
201
+ .state (' route1' , {
202
+ url: " /route1" ,
203
+ views: {
204
+ " viewA" : {
205
+ template : " route1.viewA"
206
+ },
207
+ " viewB" : {
208
+ template : " route1.viewB"
209
+ }
210
+ }
211
+ })
212
+ .state (' route2' , {
213
+ url: " /route2" ,
214
+ views: {
215
+ " viewA" : {
216
+ template : " route2.viewA"
217
+ },
218
+ " viewB" : {
219
+ template : " route2.viewB"
220
+ }
221
+ }
222
+ })
223
+ })
224
224
```
225
225
226
226
4 . See this quick start example in action.
227
- > ** [ Go to Quick Start Plunker for Multiple & Named Views] ( http://plnkr.co/edit/vDURUN ?p=preview ) **
227
+ > ** [ Go to Quick Start Plunker for Multiple & Named Views] ( http://plnkr.co/edit/SDOcGS ?p=preview ) **
228
228
229
229
5 . This only scratches the surface! You've only seen Named Views and Parallel Views.
230
230
> ** [ Dive Deeper!] ( https://github.com/angular-ui/ui-router/wiki ) **
You can’t perform that action at this time.
0 commit comments