angular-ui / angular-ui/ui-router

Access states' custom data-object in component

Aperta
#3,845 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
13.4k
Fork
2.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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...

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.