File tree 1 file changed +31
-5
lines changed
1 file changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -396,18 +396,44 @@ app.run(function($state) {
396
396
})
397
397
` ` `
398
398
399
- ## Template Required
399
+ ## ` resolve ` inside ` views `
400
400
401
- Templates (or a component) are now required for all views.
401
+ We no longer process ` resolve ` blocks that are declared inside a ` views` .
402
402
403
- If (for any reason) your state doesn't really need a template, use an empty one like so:
403
+
404
+ We used to allow resolves to be declared in a view:
404
405
405
406
` ` ` js
406
- $stateProvider .state (' notemplate' , {
407
- template: ' <!-- -->'
407
+ .state (' foo' , {
408
+ views: {
409
+ foo: {
410
+ template: ' <h1>foo</h1>' ,
411
+ resolve: { fooData : () => ' fooData' },
412
+ },
413
+ bar: {
414
+ template: ' <h1>bar</h1>' ,
415
+ resolve: { barData : () => ' barData' },
416
+ }
417
+ }
408
418
})
409
419
` ` `
410
420
421
+ Now, move all resolves out to a ` resolve` block on the state:
422
+
423
+ ` ` ` js
424
+ .state (' foo' , {
425
+ views: {
426
+ foo: { template: ' <h1>foo</h1>' },
427
+ bar: { template: ' <h1>bar</h1>' },
428
+ },
429
+ resolve: {
430
+ fooData : () => ' fooData' ,
431
+ barData : () => ' barData' ,
432
+ },
433
+ })
434
+
435
+ ` ` `
436
+
411
437
## Prototypal inherited ` .data `
412
438
413
439
This is technically a breaking change in 0.2.16, but is worth mentioning.
You can’t perform that action at this time.
0 commit comments