We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

pb with emberjs syntax: {{#each}}

Hi I'm trying to use emberjs. double brackets are used in this library, eg {{#each}}

This produce a Volt compling error: Scanning error before 'each}}

is there a workaround ?



7.5k
Accepted
answer

You can write this way {{ '{{#each}}' }}

Of course better approach is loading javascript views by some sort of api with php view engine. Of course even better are static html files. Only drawback of static files is that in js app you must have your own i18n system.



43.9k

Hi, thank you for help.

{{ '{{#each}}' }} output raw text {{#each}}
-(

I've also tried with phtml view file but the output is the same raw text ...



43.9k

I've just tried with a static html page, and same result ... so there must be something wrong in my js code.

but that is the point.

Phalcon just return html with raw text {{#each}} it's ember responsibility to make magic here. If this don't work than in your ember code is something wrong. I can't help you with ember because I use this approach in AngularJS and have no problems if angular app is proper initilized with java script.

Please first try write your ember app without phalcon (just html and javascript) and then integrate it with phalcon.



43.9k

I will investigate that further tomorrow. Time to go to bed ! Thanks again. See you later



43.9k

Late response: Your solution works well, I had problems in my js code.