Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Handlebar Helper -- helpers/if-type-is.js
- import Ember from "ember";
- export default function(type, assType) {
- return assType === type;
- }
- // Handlebar Template --- templates/assignments/reflections.hbs
- {{#each assignment in model}}
- {{#if-type-is 'reflection' assignment.type}}
- <div>
- <p>{{assignment.name}} is a reflection</p>
- </div>
- {{/if-type-is}}
- {{/each}}
- // The helper keeps getting passed two strings: "reflection" and "assignment.type" instead of the actual property value for assignment.type, and thus the condition is never satisfied and nothing is rendered.
- // What is the proper syntax for passing my helper the object's property value?
- // Thanks.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement