toddmotto / angular-component

Fully featured .component() polyfill for Angular v1.3+
https://toddmotto.com
Other
191 stars 30 forks source link

ui-router resolve #8

Closed menems closed 8 years ago

menems commented 8 years ago

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 commented 8 years ago

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

menems commented 8 years ago

yes, thanks

asadsahi commented 7 years ago

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

asadsahi commented 7 years ago

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