mustache.js is an implementation of the mustache template system in JavaScript. Mustache is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object. We call it "logic-less" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values.
Question:how to check for null value while rendering my html using mustache.js ?
Description:For example I need to render conditional Image tag, if( {{ImagePath}} != null ) { <img src="{{ImagePath}}"/> } else{ <img src="Some static path"/> }
Posted by: Khalid Abbas | Posted on: Dec 13, 2018