vendredi 15 avril 2016

How to render the route name in an Ember.js application template?

Given a list of routes:

Router.map ->
  @route 'home', path: '/'
  @route 'sign-in'
  @route 'about'

How can I dynamically render this information into my application template (main layout)?

<div id="container" class="{{routeNameGoesHere}}">
  {{outlet}}
</div>

For example, fully rendered:

<div id="container" class="sign-in">
  <h1>Sign In Page</h1>
</div>




Aucun commentaire:

Enregistrer un commentaire