Skip to content

ui-router resolve #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
menems opened this issue Jan 11, 2016 · 4 comments
Closed

ui-router resolve #8

menems opened this issue Jan 11, 2016 · 4 comments

Comments

@menems
Copy link

menems commented Jan 11, 2016

Hi

I saw that you remove bindings options 2 days ago.

So now how we can pass ui-router resolve injection on the component?

I use ui-router and component combined like that:

.state('test, {
    url: '/',
    template: '<my-component/>',
    resolve: {
        testData: function(service) {
              return service.promise();
        }
    }
}

before i used:

.state('test, {
    url: '/',
    template: '<my-component data="test.data"/>',
   controllerAs: 'test',
   controller: function(testData) {
      this.data = testData;
   }
    resolve: {
        testData: function(service) {
              return service.promise();
        }
    }
}

What is the best practice now to have the same behaviour, that is the controller is instanciate after the promise is resolved?

@toddmotto
Copy link
Owner

Does this issue need to remain open now that the bindings were added back in?

@menems
Copy link
Author

menems commented Jan 13, 2016

yes, thanks

@menems menems closed this as completed Jan 13, 2016
@asadsahi
Copy link

@menems did this work? I can't seem to get it working.

@asadsahi
Copy link

Ignore that, got it working, thanks @menems @toddmotto . Great work. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants