lib/zect.js
function compileDirective (node, scope) {
        var ast = {
                attrs: {},
                dires: {}
            }
        var dirtDefs = _getAllDirts()
        /**
         *  attributes walk
         */
        _slice(node.attributes).forEach(function(att) {
            var aname = att.name
            var v = att.value
            // parse att
            if (~componentProps.indexOf(aname)) {
                return
            } else if (_isExpr(aname)) {
                // variable attribute name
                ast.attrs[aname] = v
            } else if (aname.indexOf(NS) === 0) {
                var def = dirtDefs[aname]
                if (def) {
                    // directive
                    ast.dires[aname] = {
                        def: def,
                        expr: v
                    }
                } else {
                    return
                }
            } else if (_isExpr(v.trim())) {
                // named attribute with expression
                ast.attrs[aname] = v
            } else {
                return
            }
            node.removeAttribute(aname)
        })

        /**
         *  Attributes binding
         */
        util.objEach(ast.attrs, function(name, value) {
            var attd = new AttributeDirective(vm, scope, node, name, value)
            _directives.push(attd)
            _setBindings2Scope(scope, attd)
        })

        /**
         *  Directives binding
         */
        util.objEach(ast.dires, function(dname, spec) {
            var def = spec.def
            var expr = spec.expr
            var sep = ';'
            var d
            // multiple defines expression parse
            if (def.multi && expr.match(sep)) {
                Expression.strip(expr)
                        .split(sep)
                        .forEach(function(item) {
                            // discard empty expression 
                            if (!item.trim()) return
                            
                            d = new Directive(vm, scope, node, def, dname, '{' + item + '}')
                            _directives.push(d)
                            _setBindings2Scope(scope, d)
                        })
            } else {
                d = new Directive(vm, scope, node, def, dname, expr)
                _directives.push(d)
                _setBindings2Scope(scope, d)
            }
        })
    }
function compileDirective (node, scope) {
        var ast = {
                attrs: {},
                dires: {}
            }
        var dirtDefs = _getAllDirts()
        /**
         *  attributes walk
         */
        _slice(node.attributes).forEach(function(att) {
            var aname = att.name
            var v = att.value
            // parse att
            if (~componentProps.indexOf(aname)) {
                return
            } else if (_isExpr(aname)) {
                // variable attribute name
                ast.attrs[aname] = v
            } else if (aname.indexOf(NS) === 0) {
                var def = dirtDefs[aname]
                if (def) {
                    // directive
                    ast.dires[aname] = {
                        def: def,
                        expr: v
                    }
                } else {
                    return
                }
            } else if (_isExpr(v.trim())) {
                // named attribute with expression
                ast.attrs[aname] = v
            } else {
                return
            }
            node.removeAttribute(aname)
        })

        /**
         *  Attributes binding
         */
        util.objEach(ast.attrs, function(name, value) {
            var attd = new AttributeDirective(vm, scope, node, name, value)
            _directives.push(attd)
            _setBindings2Scope(scope, attd)
        })

        /**
         *  Directives binding
         */
        util.objEach(ast.dires, function(dname, spec) {
            var def = spec.def
            var expr = spec.expr
            var sep = ';'
            var d
            // multiple defines expression parse
            if (def.multi && expr.match(sep)) {
                Expression.strip(expr)
                        .split(sep)
                        .forEach(function(item) {
                            // discard empty expression 
                            if (!item.trim()) return
                            
                            d = new Directive(vm, scope, node, def, dname, '{' + item + '}')
                            _directives.push(d)
                            _setBindings2Scope(scope, d)
                        })
            } else {
                d = new Directive(vm, scope, node, def, dname, expr)
                _directives.push(d)
                _setBindings2Scope(scope, d)
            }
        })
    }
function compileDirective ( node , scope ) { var ast = { attrs : { } , dires : { } } var dirtDefs = _getAllDirts ( ) /**
         *  attributes walk
         */ _slice ( node . attributes ) . forEach ( function ( att ) { var aname = att . name var v = att . value // parse att if ( ~ componentProps . indexOf ( aname ) ) { return } else if ( _isExpr ( aname ) ) { // variable attribute name ast . attrs [ aname ] = v } else if ( aname . indexOf ( NS ) === 0 ) { var def = dirtDefs [ aname ] if ( def ) { // directive ast . dires [ aname ] = { def : def , expr : v } } else { return } } else if ( _isExpr ( v . trim ( ) ) ) { // named attribute with expression ast . attrs [ aname ] = v } else { return } node . removeAttribute ( aname ) } ) /**
         *  Attributes binding
         */ util . objEach ( ast . attrs , function ( name , value ) { var attd = new AttributeDirective ( vm , scope , node , name , value ) _directives . push ( attd ) _setBindings2Scope ( scope , attd ) } ) /**
         *  Directives binding
         */ util . objEach ( ast . dires , function ( dname , spec ) { var def = spec . def var expr = spec . expr var sep = ';' var d // multiple defines expression parse if ( def . multi && expr . match ( sep ) ) { Expression . strip ( expr ) . split ( sep ) . forEach ( function ( item ) { // discard empty expression  if ( ! item . trim ( ) ) return d = new Directive ( vm , scope , node , def , dname , '{' + item + '}' ) _directives . push ( d ) _setBindings2Scope ( scope , d ) } ) } else { d = new Directive ( vm , scope , node , def , dname , expr ) _directives . push ( d ) _setBindings2Scope ( scope , d ) } } ) }
Compile attributes to directive
Compile attributes to directive