From e5536fd07a4b545294d0d9f0c2b5655a038fe435 Mon Sep 17 00:00:00 2001 From: amitk Date: Sun, 16 Nov 2014 00:46:27 +0200 Subject: [PATCH] More docs --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index 779c68c..252397d 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,48 @@ define([ }; }); ``` +*Note: within the special **"rt-"** directives, simple strings don't make sense, as all those directives apply on some execution context. Therefore, in these directives, there won't be a need to add the {} to identify execution context* + +## rt-if +This gives you the ability to add conditions to a sub-tree of html. If the condition is evaluated to true, the subree will be returned, otherwise, it will not be calculated. It is implemented by a trinary expression + +Sample: +``` +
Success!
+``` +Complied: +``` +define([ + 'react', + 'lodash' +], function (React, _) { + 'use strict'; + return function () { + return this.state.resultCode === 200 ? React.DOM.div({}, 'Success!') : null; + }; +}); +``` + +## section +Section text + +Sample: +``` + +``` +Complied: +``` + +``` + +## section +Section text + +Sample: +``` + +``` +Complied: +``` + +``` \ No newline at end of file