controllerProvider on Ng1ViewDeclaration should be of type IInjectable instead of Function #3044

Closed
ciddan opened this Issue Sep 27, 2016 · 1 comment

Projects

None yet

2 participants

@ciddan
Contributor
ciddan commented Sep 27, 2016

I would expect this state definition to still be valid:

.state("product.store.live", {
    url: "/live"
    views: {
        "storeView@product": {
            controllerProvider: ["options", storeControllerProvider], // <--- compilation fail
            templateUrl: "app/components/product/detail/shared/StoreView.html"
        }
    }
})

Looking at the code in ng1/statebuilders/views.ts#getController the code looks for an ng1 array-notation-style array/function.

@christopherthielen christopherthielen added this to the 1.0.0-final milestone Sep 27, 2016
@christopherthielen
Contributor

yep, thanks for the report!

@ciddan ciddan added a commit to ciddan/ui-router that referenced this issue Oct 1, 2016
@ciddan ciddan fix(Ng1ViewDeclaration): Make controllerProvider IInjectable
Closes #3044. Changes the type of controllerProvider in Ng1ViewDeclaration to IInjectable. Adds 1 test for controller provider in ng1/stateSpec. Updates the controller handling test in ng1/viewSpec to verify that controllerProvider is IInjectable .
d5bf914
@christopherthielen christopherthielen added a commit that referenced this issue Oct 1, 2016
@ciddan @christopherthielen ciddan + christopherthielen fix(Ng1ViewDeclaration): Make controllerProvider IInjectable (#3056)
Closes #3044. Changes the type of controllerProvider in Ng1ViewDeclaration to IInjectable. Adds 1 test for controller provider in ng1/stateSpec. Updates the controller handling test in ng1/viewSpec to verify that controllerProvider is IInjectable .
a3136ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment