Giter Site home page Giter Site logo

Comments (4)

ncuillery avatar ncuillery commented on May 24, 2024

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.

grimurd avatar grimurd commented on May 24, 2024

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.

ncuillery avatar ncuillery commented on May 24, 2024

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.

ncuillery avatar ncuillery commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.