lib/render/client.js
function(component, expr1, expr2){

    var self = this;
    // basic binding

    if(!component || !(component instanceof Regular)) throw "$bind() should pass Regular component as first argument";
    if(!expr1) throw "$bind() should  pass as least one expression to bind";

    if(!expr2) expr2 = expr1;

    expr1 = parse.expression( expr1 );
    expr2 = parse.expression( expr2 );

    // set is need to operate setting ;
    if(expr2.set){
      var wid1 = this.$watch( expr1, function(value){
        component.$update(expr2, value)
      });
      component.$on('$destroy', function(){
        self.$unwatch(wid1)
      })
    }
    if(expr1.set){
      var wid2 = component.$watch(expr2, function(value){
        self.$update(expr1, value)
      });
      // when brother destroy, we unlink this watcher
      this.$on('$destroy', component.$unwatch.bind(component,wid2))
    }
    // sync the component's state to called's state
    expr2.set(component, expr1.get(this));
  }
function(component, expr1, expr2){

    var self = this;
    // basic binding

    if(!component || !(component instanceof Regular)) throw "$bind() should pass Regular component as first argument";
    if(!expr1) throw "$bind() should  pass as least one expression to bind";

    if(!expr2) expr2 = expr1;

    expr1 = parse.expression( expr1 );
    expr2 = parse.expression( expr2 );

    // set is need to operate setting ;
    if(expr2.set){
      var wid1 = this.$watch( expr1, function(value){
        component.$update(expr2, value)
      });
      component.$on('$destroy', function(){
        self.$unwatch(wid1)
      })
    }
    if(expr1.set){
      var wid2 = component.$watch(expr2, function(value){
        self.$update(expr1, value)
      });
      // when brother destroy, we unlink this watcher
      this.$on('$destroy', component.$unwatch.bind(component,wid2))
    }
    // sync the component's state to called's state
    expr2.set(component, expr1.get(this));
  }
function ( component , expr1 , expr2 ) { var self = this ; // basic binding if ( ! component || ! ( component instanceof Regular ) ) throw "$bind() should pass Regular component as first argument" ; if ( ! expr1 ) throw "$bind() should  pass as least one expression to bind" ; if ( ! expr2 ) expr2 = expr1 ; expr1 = parse . expression ( expr1 ) ; expr2 = parse . expression ( expr2 ) ; // set is need to operate setting ; if ( expr2 . set ) { var wid1 = this . $watch ( expr1 , function ( value ) { component . $update ( expr2 , value ) } ) ; component . $on ( '$destroy' , function ( ) { self . $unwatch ( wid1 ) } ) } if ( expr1 . set ) { var wid2 = component . $watch ( expr2 , function ( value ) { self . $update ( expr1 , value ) } ) ; // when brother destroy, we unlink this watcher this . $on ( '$destroy' , component . $unwatch . bind ( component , wid2 ) ) } // sync the component's state to called's state expr2 . set ( component , expr1 . get ( this ) ) ; }
private bind logic
private bind logic