Unable to send data in Handlebars helpers


#1

I’ve created helper for handlebars. When I try to send data to this helper from template, it shows me variable name as text. For example:

I’ve created helper:

Ember.Handlebars.registerHelper(‘ifinarray’, function(context, options) { alert(context); });

And called this:

{{ifinarray appointment_time}}

Rather than showing value of appointment_time, it shows “appointment_time” as string.

I’ve also tried another way like this - {{#ifinarray appointment.appointment_time}} {{/ifinarray}}

But didn’t get success.

Can any one help me on this.


#2

Hi mukeshsingh3,

I think this Stackoverflow answer can help you.


#3

Thanks, It was really helpful.