javascript - Make navigation item active when route doesn't match -


I have noticed that if you are on the path, your page matches a link with the same path, So it automatically takes the class 'active'

I am currently building a navigation bar which is using it, but my concern is that all my passages do not match my navigation bar.

For example, when I am in the route / message>, then I want to activate the item / services or when I use route / Forum / history , then I want to activate the item / forum / archive even though this route is not in navigation, I still want to highlight the item which is related to it is.

My navigation comes from a Jason object that looks like this:

  ["label": "forum", "link": "forum", " Children ": [{" label ":" latest "" link ":" forums.latest "} {" label ":" archives "" link ":" forums. I had some ideas that I did not like, this is the reason why I am coming here to take your advice. These are my thoughts:  

/ P>

  • Define a property to determine which items should be active in Navigation:

    View / Forums / History.js:

    • To my Jason object

      >

        router.map (function () {this.route ('forum', function () {this.route ('latest'); root ('archives'); this.route (' History ');});});   

      Do you have any such good suggestions? Thanks

      Use current-when parameter {{# link-to}}. This will allow you to define alternative routes that link to Causes to be activated.

      Because amber 1.8 can currently accept delimited strings of routes, works in 1.7 for implementation, check out

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -