if else..if condition in handlebars

Published

Here is my code with angularjs and handlerbars,

{{#if myData.student}}
  <student-list></student-list>
{{else if myData.teacher}}
  <teacher-list></teacher-list>
{{else}}
   <cities-list></cities-list>
{{/if}}

I need to check the scope object value before {{else if myData.teacher}} , any way to do please? tried this below but not working.

<div ng-controller="universityCtrl">  
  {{#if myData.student}}
    <student-list></student-list>
  <span ng-if="scopeData.dislayTeacher">
  {{else if myData.teacher}}
    <teacher-list></teacher-list>
  </span>
  {{else}}
    <cities-list></cities-list>
  {{/if}}   

Source: AngularJS Questions

Published
Categorized as angularjs, handlebars.js Tagged ,

Answers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq