ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

Resolve var of child not being called in 0.2.15, it does in 0.2.14

Open deeweey opened this issue 11 years ago • 7 comments

See http://jsbin.com/wocudotoqu/1/edit?html,js,console. In 0.2.14 it returns I am state:sub, in 0.2.15 I am state:master.

Not sure what the expected behaviour is but just to let you know that the behaviour changed in the latest release. It was a breaking change for our app.

deeweey avatar Jun 01 '15 15:06 deeweey

Dewey,

I think this is indeed a bug (although I'm unsure what would have caused this change). However, if you move your resolve to the state instead of the view, the proper resolve is injected in 0.2.15.

      .state('main.sub', {
        url: '/sub',
        resolve: {
              myVar: function() {
                return 'I am state:sub';
              }
            }
        views: {
          'content@': {
            controller: 'SubCtrl'        
          }
        }

christopherthielen avatar Jun 01 '15 19:06 christopherthielen

Can you check if my pull request (#1991) fix this? I had the same issue.

chris1705 avatar Jun 02 '15 19:06 chris1705

Any progress on this? I'm having issues upgrading my apps due to this.

rdpacheco avatar Nov 16 '15 23:11 rdpacheco

Move your resolves from the views to the state. I don't think we ever explicitly supported resolves on a view, did we @nateabele? I don't believe 1.0 implements resolves on a view.

christopherthielen avatar Jan 24 '16 04:01 christopherthielen

A long, long time ago we did. It inadvertently got dropped in a point release, but no one seemed to notice. I think hardly anyone ever used it.

nateabele avatar Jan 24 '16 17:01 nateabele

I used it, just because it made sense to resolve data "to" the view where it is needed and keep it away from views that need other data ...

towu avatar Jan 25 '16 13:01 towu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.

stale[bot] avatar Jan 24 '20 11:01 stale[bot]