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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -