Comments (4)
Hi,
I think we have two problems here: misleading representation of inheritance between states and a real bug.
First, state inheritance: Labels are interpolated against the scope of the current state controller (for a single view state). It means that your root.ui.container.category
must have the category name attach to the scope (of course) but also the container name if you want it in the breadcrumb. See the UI-router doc about states inheritance.
Then, the bug:
When a state have multiple views, each view triggers the interpolation of labels against its own scope. In the root.ui.container.category.scenario
, the breadcrumb is lastly triggered by the view [email protected]
which has no information in its scope (scenario.name
, category.name
and container.name
). That's why the breadcrumb is empty.
What's happen if you remove the view [email protected]
in the root.ui.container.category.scenario
state ? The breadcrumb should display at least the correct label for the root.ui.container.category.scenario
state.
Please confirm my hypothesis is good and I'll start examining the bug.
PS: I love your country
from angular-breadcrumb.
I tried setting the labels for container, category and scenario in every single controller but that didn't work. However if i put
data: {
ncyBreadcrumbLabel: '{{$stateParams.scenarioName}}'
}
The url encoded scenario name will appear as the breadcrumb label. The same happens if i do it with categories and containers.
As you suggested I removed the [email protected] block from the state definition but it didn't change anything in the breadcrumbs. The label for scenario didn't appear.
P.S: It's all right but way over-hyped :)
from angular-breadcrumb.
Hmm, that's curious.
I made this plunker where I copy/paste your configuration. The only changes I have made are:
- Replace
templateUrl
by inline test templates - Remove the second view of the scenario state
In the controllers (scenarioCtrl & categoryCtrl), I load the underlying entities (container & category). And the breadcrumb works.
Is it that way you set the labels for container, category and scenario in every single controller ?
Feel free to fork and edit the plunker to reveal your problem. (I prefer keep the multiple view problem for later, one thing after another).
from angular-breadcrumb.
I close this issue to keep the bug tracker clear.
Feel free to reopen this issue is your problem is still here.
Please note that the issue about multiple views is still pending. I keep trace of it here: #62
from angular-breadcrumb.
Related Issues (20)
- Wiki addition
- Does "getStatesChain" consider state parameters to add a state to the state chain?
- Unexpected behavior, Views are changing automatically. HOT 1
- Direct links & stateParams HOT 2
- NG1 ES6 components usage HOT 10
- Doesn't work with Angular 1.6 components HOT 3
- Angular Material support for BreadCrumb
- Access state's controller scope in breadcrumb template
- Bootstrap 4 HOT 1
- Loss of context in breadcrumb labels HOT 1
- TypeError: Cannot read property 'ncyBreadcrumb' of null HOT 3
- How to send parameter HOT 1
- navigation fails if parent state requires stateparams
- Expose parameter for label from named view
- Dynamic breadcrumbs not showing on reload with ui-router 1.0.4
- Update to use transition hook API instead of state change events
- Angular 2 version?
- Unable to access $resolve for some components
- Dropdown element as Breadcrumb step
- how to set ncyBreadcrumbLink HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-breadcrumb.