Coder Social home page Coder Social logo

Comments (3)

kktos avatar kktos commented on June 1, 2024

Boris,

do you plan to add it, if you please, Monsieur ?
because it's becoming a nightmare for me....
sometimes, I can deal with simple add or sub to replace the && and ||.
but sometimes I'm stuck.....

cheers,
/k

from jsrender.

kktos avatar kktos commented on June 1, 2024

ah ! got it at last !
it works...but under certain condition, surely because of the parser regex ;)

This won't work:

$.template(null,'<#if name=="" && age>18 *>NEW</if*>');
function () {
return viewsNs.err( e );
}

But this will:

$.template(null,'<#if name==""&&age>18 *>NEW</if*>');
function anonymous($data, $view) {
try{var views=jQuery.views,tag=views.renderTag,enc=views.encode,html=views.encoders.html,$ctx=$view && $view.ctx,result=""+

tag("if",$view,"",1,{_path:'$data.name==""&&$data.age>18'},$data.name==""&&$data.age>18);return result;

}catch(e){return views.err(e);}
}

no space between subexpressions ! ;)

from jsrender.

BorisMoore avatar BorisMoore commented on June 1, 2024

Fixed in the latest updates. There is now very full expression support.
See some examples here:

http://borismoore.github.com/jsrender/demos/step-by-step/10_comparison-tests.html
https://github.com/BorisMoore/jsrender/blob/master/demos/step-by-step/10_comparison-tests.html

http://borismoore.github.com/jsrender/test/unit-tests-no-jquery.html?filter=%7B%7B%3A%7D%7D%3A%20comparisons
http://borismoore.github.com/jsrender/test/unit-tests-no-jquery.html?filter=%7B%7B%3A%7D%7D%3A%20expressions
https://github.com/BorisMoore/jsrender/blob/master/test/unit/jsrender-tests-no-jquery.js

from jsrender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.