1.1.12 • Published 10 years ago
activejade v1.1.12
ActiveJade
activejade.org The main difference with original Jade is that this version is targeted to work in tandem with MVVM framework like AngularJs. The compiler compiles jade template into JS file instead HTML, and you can link this template on your page and use it as a regular AngularJs's template.
What Have Done and What Is In Progress
Done
- Tags, Attributes, Text, Expressions
- Mixin Declare, Mixin Call
- Decorators
- Include
- IfElse, While, ForIn, CaseWhen
- References and promises
- Except Statement
In Progress
- Extends, Blocks
- Filters, IncludeFilters
- AngularJs ecosystem integration
- Tests: port from original Jade and tests to check proper DOM manipulations
Plans on Future
breakandcontinuestatements
Differences Between Original Jade
- It's parser and lexer completely rewritten based on
Jison - It has extended JavaScript expression syntax (since in is parsing JavaScript as well):
- array range generator operator
..(i.e.7..9=>[ 7, 8, 9 ]) - euclid operator
?.(i.e.a.b?.c=>(a.b||{}).c) - slicing operator
[:](i.e.[ 1, 2, 3, 4 ][1:2]=>[ 2, 3 ]) - different behavior of
varoperator - may have
#element-idto access to element by id:div#test-1 ... some code - #test-1.innerHTML = #test-n.innerHTML ... some code div#test-n
- array range generator operator
- It has decorators(can be applied to tags or mixin calls):
div
@On('click', a += 1)
div
span TestOr
div
@On('click', a += 1)
+awesome-button("green") Press Meforloop:- may have
ifclause:``` div for k, chbx in checkboxes if chbx.checked span #{k} is checked ``` - may have
elseclause:``` div for v in test a= v else div No Items ```
- may have
Statement operator allowing only
varanddeleteoperations (originally was allowed plain JavaScript)includechanges:- optional
withstatement (for isolating scope) - source parameter may be an expression (
extendwill have it too)
- optional
for,if,while,caseandincludestatements may have optionalexceptstatement:
if test
div OK
except
wait
div The promise is still not resolved!
error msg
div Oh! Promise was rejected with message: #{msg}For include the except statement has different syntax:
include promise
wait
div Please wait...Standard Decorators
@on- to attach event listener to tag element
1.1.12
10 years ago
1.1.11
10 years ago
1.1.10
10 years ago
1.1.9
10 years ago
1.1.8
10 years ago
1.1.7
10 years ago
1.1.6
10 years ago
1.1.5
10 years ago
1.1.4
10 years ago
1.1.3
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.9
10 years ago
1.0.8
10 years ago
1.0.7
10 years ago
1.0.6
10 years ago
1.0.5
10 years ago
1.0.4
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago