Google Groups

Re: ember.js and conflict with template {{ }} marks ...

Anthony Feb 3, 2012 12:46 PM
Posted in group: web2py-users
You could do this: The only downside is you have to call the special render() function in each controller instead of relying on web2py's default handling of the rendering.

Another option is to create a special helper for your ember markup:

In a model or imported from a module:
class em(DIV):
    tag = ''
    def xml(self):
        return '{{%s}}' % super(em, self).xml()

In web2py view:
{{=em('stuff that goes in ember markup')}}
{{=em('stuff that goes in ember markup, ', A('including nested web2py helpers', _href='#'))}}
{{=A(em('ember markup nested in a web2py helper'), _href='#')}}

{{stuff that goes in ember markup}}
{{more stuff, <a href="#">including nested web2py helpers</a>}}
<a href="#">{{ember markup embedded in a web2py helper}}</a>

Ultimately, it would be nice if the web2py markup tags were more easily configurable. I was thinking it might be nice to do so in -- that way you could specify custom tags on a per view basis (though if the views extend a layout, the layout would have to have the same custom tags as the view).


On Friday, February 3, 2012 3:00:12 PM UTC-5, David Marko wrote:
Hello, it was discussed earlier but with no result. I would like to use ember.js  which uses {{}} for its template language. This conflicts with web2py template and causes errors. I there a way how to incorporate some special web2py tag, that will allow web2py to skip its content as is without evaluating it as web2py template? Or is there anyone who found good solution for this?

thank you ...