Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Angular 1.6 broke ui-router component resolves #15545

@vjoao

Description

@vjoao

Do you want to request a feature or report a bug?
I guess it's a bug

What is the current behavior?
On Angular 1.5.8 my project was working normally.
I use resolvers on ui-router (1.0.0-beta.3) with components like this:

.state('companies', {
      url: '/companies',
      component: 'companiesPage',
      resolve: {
           companies ($q) {
                 "ngInject";
                 ... some code to build the array of promises;
                 return $q.all( array of promises); 
           }
      }
})

And my companiesPage component follows:

let companiesPageComponent = {
  bindings: {
    companies: '<',
  },
  template,
  controller
};

On Angular 1.5.8 I could access the companies variable inside my controller with this.companies which is an array as a result of my component resolve.
When updating to Angular 1.6.1 this.companies is undefined.

Any thoughts?

I'm sticking with Angular 1.5.8 for now as I have to deliver this project ASAP.

What is the expected behavior?

ui-router resolves should work with component bindings and you should be able to access them on controller.

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.

Angular 1.6.1

Other information (e.g. stacktraces, related issues, suggestions how to fix)

Not really. It's just returning undefined from my route resolve function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions