ember.js - Ember 2.1.0 render partial if index page else another partial -


in templates/application.hbs able set condition check if index page render navigation it, else render set of navigation in-app pages. same footer. best way check this? also, whether user login or not doesn't matter.

my research has lead outdated code or convention. i'm new ember appreciated.

here emblem attempt, not working:

if eq currentroutename="index" = partial 'partialname' else = partial 'partialname2'

second attempt works:

first run: ember install ember-truth-helpers

add application template:

if (eq currentroutename "index") = partial 'partialname' else = partial 'partialname2'

the application controller has property currentroutename. can choose navigation render based on value.

in application.hbs

{{#if (eq currentroutename "index")}}   render navigation index page {{else}}   render navigation other pages {{/if}} 

the eq helper comes ember-truth-helpers


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -