lib/zect.js
function compileElement(node, scope, isRoot) {
        var tagName = node.tagName
        var inst
        switch(true) {
            /**
             *  <*-if></*-if>
             */
            case is.IfElement(tagName):
                var children = _slice(node.children)
                var exprs = [$(node).attr('is')]
                children.forEach(function(c) {
                    if (is.ElseElement(c)) {
                        exprs.push($(c).attr(conf.namespace + 'else') || '')
                    }
                })
                inst = new ElementDirective(
                        vm, 
                        scope,
                        node, 
                        elements['if'], 
                        NS + 'if', 
                        exprs
                )
                if (!isRoot) {
                    inst.$mount(node)
                }
                // save elements refs
                _directives.push(inst)
                // save bindins to scope
                _setBindings2Scope(scope, inst)
                return inst
            /**
             *  <*-repeat></*-repeat>
             */
            case is.RepeatElement(tagName):
                inst = new ElementDirective(
                        vm, 
                        scope,
                        node, 
                        elements.repeat,
                        NS + 'repeat', 
                        $(node).attr('items')
                )
                if (!isRoot) {
                    inst.$mount(node)
                }
                _directives.push(inst)
                _setBindings2Scope(scope, inst)
                return inst
        }
    }
function compileElement(node, scope, isRoot) {
        var tagName = node.tagName
        var inst
        switch(true) {
            /**
             *  <*-if></*-if>
             */
            case is.IfElement(tagName):
                var children = _slice(node.children)
                var exprs = [$(node).attr('is')]
                children.forEach(function(c) {
                    if (is.ElseElement(c)) {
                        exprs.push($(c).attr(conf.namespace + 'else') || '')
                    }
                })
                inst = new ElementDirective(
                        vm, 
                        scope,
                        node, 
                        elements['if'], 
                        NS + 'if', 
                        exprs
                )
                if (!isRoot) {
                    inst.$mount(node)
                }
                // save elements refs
                _directives.push(inst)
                // save bindins to scope
                _setBindings2Scope(scope, inst)
                return inst
            /**
             *  <*-repeat></*-repeat>
             */
            case is.RepeatElement(tagName):
                inst = new ElementDirective(
                        vm, 
                        scope,
                        node, 
                        elements.repeat,
                        NS + 'repeat', 
                        $(node).attr('items')
                )
                if (!isRoot) {
                    inst.$mount(node)
                }
                _directives.push(inst)
                _setBindings2Scope(scope, inst)
                return inst
        }
    }
function compileElement ( node , scope , isRoot ) { var tagName = node . tagName var inst switch ( true ) { /**
             *  <*-if></*-if>
             */ case is . IfElement ( tagName ) : var children = _slice ( node . children ) var exprs = [ $ ( node ) . attr ( 'is' ) ] children . forEach ( function ( c ) { if ( is . ElseElement ( c ) ) { exprs . push ( $ ( c ) . attr ( conf . namespace + 'else' ) || '' ) } } ) inst = new ElementDirective ( vm , scope , node , elements [ 'if' ] , NS + 'if' , exprs ) if ( ! isRoot ) { inst . $mount ( node ) } // save elements refs _directives . push ( inst ) // save bindins to scope _setBindings2Scope ( scope , inst ) return inst /**
             *  <*-repeat></*-repeat>
             */ case is . RepeatElement ( tagName ) : inst = new ElementDirective ( vm , scope , node , elements . repeat , NS + 'repeat' , $ ( node ) . attr ( 'items' ) ) if ( ! isRoot ) { inst . $mount ( node ) } _directives . push ( inst ) _setBindings2Scope ( scope , inst ) return inst } }
Compile element for block syntax handling
Compile element for block syntax handling