How to use the aurelia-metadata.mixin function in aurelia-metadata

To help you get started, we’ve selected a few aurelia-metadata examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / templating-resources / dist / commonjs / aurelia-templating-resources.js View on Github external
var TwoWayBindingBehavior = (function () {
    function TwoWayBindingBehavior() {
        this.mode = aureliaBinding.bindingMode.twoWay;
    }
    TwoWayBindingBehavior = __decorate([
        aureliaMetadata.mixin(modeBindingBehavior),
        aureliaBinding.bindingBehavior('twoWay')
    ], TwoWayBindingBehavior);
    return TwoWayBindingBehavior;
}());
github aurelia / templating-resources / dist / aurelia-templating-resources.js View on Github external
@bindingBehavior('oneTime')
export class OneTimeBindingBehavior {
  constructor() {
    this.mode = bindingMode.oneTime;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('oneWay')
export class OneWayBindingBehavior {
  constructor() {
    this.mode = bindingMode.toView;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('toView')
export class ToViewBindingBehavior {
  constructor() {
    this.mode = bindingMode.toView;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('fromView')
export class FromViewBindingBehavior {
  constructor() {
    this.mode = bindingMode.fromView;
  }
}

@mixin(modeBindingBehavior)
github aurelia / templating-resources / dist / es2015 / binding-mode-behaviors.js View on Github external
}
}) || _class2) || _class2);

export let ToViewBindingBehavior = (_dec5 = mixin(modeBindingBehavior), _dec6 = bindingBehavior('toView'), _dec5(_class3 = _dec6(_class3 = class ToViewBindingBehavior {
  constructor() {
    this.mode = bindingMode.toView;
  }
}) || _class3) || _class3);

export let FromViewBindingBehavior = (_dec7 = mixin(modeBindingBehavior), _dec8 = bindingBehavior('fromView'), _dec7(_class4 = _dec8(_class4 = class FromViewBindingBehavior {
  constructor() {
    this.mode = bindingMode.fromView;
  }
}) || _class4) || _class4);

export let TwoWayBindingBehavior = (_dec9 = mixin(modeBindingBehavior), _dec10 = bindingBehavior('twoWay'), _dec9(_class5 = _dec10(_class5 = class TwoWayBindingBehavior {
  constructor() {
    this.mode = bindingMode.twoWay;
  }
}) || _class5) || _class5);
github aurelia / templating-resources / dist / aurelia-templating-resources.js View on Github external
}
}

let modeBindingBehavior = {
  bind(binding, source, lookupFunctions) {
    binding.originalMode = binding.mode;
    binding.mode = this.mode;
  },

  unbind(binding, source) {
    binding.mode = binding.originalMode;
    binding.originalMode = null;
  }
};

@mixin(modeBindingBehavior)
@bindingBehavior('oneTime')
export class OneTimeBindingBehavior {
  constructor() {
    this.mode = bindingMode.oneTime;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('oneWay')
export class OneWayBindingBehavior {
  constructor() {
    this.mode = bindingMode.toView;
  }
}

@mixin(modeBindingBehavior)
github aurelia / templating-resources / src / binding-mode-behaviors.ts View on Github external
this.mode = bindingMode.oneTime;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('oneWay')
export class OneWayBindingBehavior {
  
  mode: bindingMode;

  constructor() {
    this.mode = bindingMode.toView;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('toView')
export class ToViewBindingBehavior {
  
  mode: bindingMode;

  constructor() {
    this.mode = bindingMode.toView;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('fromView')
export class FromViewBindingBehavior {
  
  mode: bindingMode;
github aurelia / templating-resources / dist / es2015 / binding-mode-behaviors.js View on Github external
}
};

export let OneTimeBindingBehavior = (_dec = mixin(modeBindingBehavior), _dec2 = bindingBehavior('oneTime'), _dec(_class = _dec2(_class = class OneTimeBindingBehavior {
  constructor() {
    this.mode = bindingMode.oneTime;
  }
}) || _class) || _class);

export let OneWayBindingBehavior = (_dec3 = mixin(modeBindingBehavior), _dec4 = bindingBehavior('oneWay'), _dec3(_class2 = _dec4(_class2 = class OneWayBindingBehavior {
  constructor() {
    this.mode = bindingMode.toView;
  }
}) || _class2) || _class2);

export let ToViewBindingBehavior = (_dec5 = mixin(modeBindingBehavior), _dec6 = bindingBehavior('toView'), _dec5(_class3 = _dec6(_class3 = class ToViewBindingBehavior {
  constructor() {
    this.mode = bindingMode.toView;
  }
}) || _class3) || _class3);

export let FromViewBindingBehavior = (_dec7 = mixin(modeBindingBehavior), _dec8 = bindingBehavior('fromView'), _dec7(_class4 = _dec8(_class4 = class FromViewBindingBehavior {
  constructor() {
    this.mode = bindingMode.fromView;
  }
}) || _class4) || _class4);

export let TwoWayBindingBehavior = (_dec9 = mixin(modeBindingBehavior), _dec10 = bindingBehavior('twoWay'), _dec9(_class5 = _dec10(_class5 = class TwoWayBindingBehavior {
  constructor() {
    this.mode = bindingMode.twoWay;
  }
}) || _class5) || _class5);
github aurelia / templating-resources / src / binding-mode-behaviors.ts View on Github external
import { bindingBehavior, bindingMode } from 'aurelia-binding';
import { mixin } from 'aurelia-metadata';

let modeBindingBehavior = {
  bind(binding, source, lookupFunctions) {
    binding.originalMode = binding.mode;
    binding.mode = this.mode;
  },

  unbind(binding, source) {
    binding.mode = binding.originalMode;
    binding.originalMode = null;
  }
};

@mixin(modeBindingBehavior)
@bindingBehavior('oneTime')
export class OneTimeBindingBehavior {

  mode: bindingMode;

  constructor() {
    this.mode = bindingMode.oneTime;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('oneWay')
export class OneWayBindingBehavior {
  
  mode: bindingMode;
github aurelia / templating-resources / dist / native-modules / binding-mode-behaviors.js View on Github external
binding.originalMode = binding.mode;
    binding.mode = this.mode;
  },
  unbind: function unbind(binding, source) {
    binding.mode = binding.originalMode;
    binding.originalMode = null;
  }
};

export var OneTimeBindingBehavior = (_dec = mixin(modeBindingBehavior), _dec2 = bindingBehavior('oneTime'), _dec(_class = _dec2(_class = function OneTimeBindingBehavior() {
  

  this.mode = bindingMode.oneTime;
}) || _class) || _class);

export var OneWayBindingBehavior = (_dec3 = mixin(modeBindingBehavior), _dec4 = bindingBehavior('oneWay'), _dec3(_class2 = _dec4(_class2 = function OneWayBindingBehavior() {
  

  this.mode = bindingMode.toView;
}) || _class2) || _class2);

export var ToViewBindingBehavior = (_dec5 = mixin(modeBindingBehavior), _dec6 = bindingBehavior('toView'), _dec5(_class3 = _dec6(_class3 = function ToViewBindingBehavior() {
  

  this.mode = bindingMode.toView;
}) || _class3) || _class3);

export var FromViewBindingBehavior = (_dec7 = mixin(modeBindingBehavior), _dec8 = bindingBehavior('fromView'), _dec7(_class4 = _dec8(_class4 = function FromViewBindingBehavior() {
  

  this.mode = bindingMode.fromView;
}) || _class4) || _class4);
github aurelia / templating-resources / dist / aurelia-templating-resources.js View on Github external
unbind(binding, source) {
    binding.mode = binding.originalMode;
    binding.originalMode = null;
  }
};

@mixin(modeBindingBehavior)
@bindingBehavior('oneTime')
export class OneTimeBindingBehavior {
  constructor() {
    this.mode = bindingMode.oneTime;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('oneWay')
export class OneWayBindingBehavior {
  constructor() {
    this.mode = bindingMode.toView;
  }
}

@mixin(modeBindingBehavior)
@bindingBehavior('toView')
export class ToViewBindingBehavior {
  constructor() {
    this.mode = bindingMode.toView;
  }
}

@mixin(modeBindingBehavior)
github aurelia / templating-resources / dist / native-modules / binding-mode-behaviors.js View on Github external
import { bindingMode, bindingBehavior } from 'aurelia-binding';
import { mixin } from 'aurelia-metadata';

var modeBindingBehavior = {
  bind: function bind(binding, source, lookupFunctions) {
    binding.originalMode = binding.mode;
    binding.mode = this.mode;
  },
  unbind: function unbind(binding, source) {
    binding.mode = binding.originalMode;
    binding.originalMode = null;
  }
};

export var OneTimeBindingBehavior = (_dec = mixin(modeBindingBehavior), _dec2 = bindingBehavior('oneTime'), _dec(_class = _dec2(_class = function OneTimeBindingBehavior() {
  

  this.mode = bindingMode.oneTime;
}) || _class) || _class);

export var OneWayBindingBehavior = (_dec3 = mixin(modeBindingBehavior), _dec4 = bindingBehavior('oneWay'), _dec3(_class2 = _dec4(_class2 = function OneWayBindingBehavior() {
  

  this.mode = bindingMode.toView;
}) || _class2) || _class2);

export var ToViewBindingBehavior = (_dec5 = mixin(modeBindingBehavior), _dec6 = bindingBehavior('toView'), _dec5(_class3 = _dec6(_class3 = function ToViewBindingBehavior() {
  

  this.mode = bindingMode.toView;
}) || _class3) || _class3);