matteodem / meteor-easy-search

Easy-to-use search for Meteor with Blaze Components
MIT License
438 stars 68 forks source link

Make {{ @index }} available inside a {{ #EasySearch.Each }} #559

Closed huguesbrunelle closed 7 years ago

huguesbrunelle commented 7 years ago

Hello there,

Really cool plugin but in my recent project I use {{@index}} inside a normal {{#each}} loop but when I implemented {{ #EasySearch.Each }}, the {{@index}} make the app crash with this error :

Error: Unsupported directive: @index

Thanks for your time and this really cool package :)

matteodem commented 7 years ago

the fix might be as easy as adding @index=@index to here https://github.com/matteodem/meteor-easy-search/blob/master/packages/easysearch:components/lib/each/each.html#L3.

I gladly accept help in form of PRs as I'm quite busy with other work right now.

huguesbrunelle commented 7 years ago

Wow thanks I didn't know we could make our own templating that way. I'll try this today for sure and let you know. Thanks a lot.

huguesbrunelle commented 7 years ago

@matteodem not sure to understand tho. I've installed easy:search so easysearch:components should be wrap with it. When I try to create my own template name="EasySearch.Each" it says that a template of that name already exist. I never overwritten an existing template before so if you could help me once more on this it would be much appreciated.

matteodem commented 7 years ago

It would have to be fixed as a PR. Fixing in your app is only possible by installing the package locally.

huguesbrunelle commented 7 years ago

Ok got it. So I can contribute by fixing it and PR you. Didn't understand that the first time. Ok I'll be glad to do it later today.

matteodem commented 7 years ago

This is published in the latest version! See https://github.com/matteodem/meteor-easy-search/commit/4e988ba92a8330821264c29e4875c8a59626a863 if you're interested in the implementation details.

huguesbrunelle commented 7 years ago

Just implemented it. Works perfectly!!! Thanks a lot. I'll tell another person who was looking for this on a forum... Have a great day and Holidays.

matteodem commented 7 years ago

You too, thank you!