Skip to content
New issue

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

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

Already on GitHub? # to your account

Access states' custom data-object in component #3845

Open
2 tasks
Vortilion opened this issue Mar 22, 2022 · 0 comments
Open
2 tasks

Access states' custom data-object in component #3845

Vortilion opened this issue Mar 22, 2022 · 0 comments

Comments

@Vortilion
Copy link

This issue tracker is for Bug Reports and Feature Requests only.

Please direct requests for help to StackOverflow.
See http://bit.ly/UIR-SOF for details.

This is a (check one box):

  • Bug Report
  • Feature Request
  • [x ] General Query

My version of UI-Router is: 9.1.0

General Query

Im migrating an AngularJS-App with ui-router to Angular 12 with ui-router 2 and trying to find out how I can access custom data-objects I define in a state.

State:
export const homeState = {
name: 'layout.home',
url: '/home',
component: CwpHomePageComponent,
data: {
title: 'Startseite'
}
};

How would I now access the data-object which contains the page title? In AngularJS we used $state.current.data but for ui-router 2 it says "current" is deprecated... What is the recommended solution now? Cant find anything in the docs...

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

No branches or pull requests

1 participant