diff --git a/bower.json b/bower.json index 42804c8b..08490d5c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "1.0.0-beta.1.2.0", + "version": "1.0.0-beta.1.2.1", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-templating.js b/dist/amd/aurelia-templating.js index 1d554896..332de74c 100644 --- a/dist/amd/aurelia-templating.js +++ b/dist/amd/aurelia-templating.js @@ -931,7 +931,7 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aureli this.bindings.push(binding); if (this.isBound) { - binding.bind(this.bindingContext); + binding.bind(this); } }; @@ -946,9 +946,6 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aureli this.isBound = false; this.resources._invokeHook('beforeUnbind', this); - this.bindingContext = null; - this.overrideContext = null; - if (this.controller !== null) { this.controller.unbind(); } @@ -967,6 +964,9 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aureli for (i = 0, ii = children.length; i < ii; ++i) { children[i].unbind(); } + + this.bindingContext = null; + this.overrideContext = null; } }; @@ -2985,7 +2985,9 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aureli } this.attribute = this.attribute || _hyphenate(this.name); - this.defaultBindingMode = this.defaultBindingMode || _aureliaBinding.bindingMode.oneWay; + if (this.defaultBindingMode === null || this.defaultBindingMode === undefined) { + this.defaultBindingMode = _aureliaBinding.bindingMode.oneWay; + } this.changeHandler = this.changeHandler || null; this.owner = null; this.descriptor = null; diff --git a/dist/aurelia-templating.js b/dist/aurelia-templating.js index da6bbd8e..cfea3d66 100644 --- a/dist/aurelia-templating.js +++ b/dist/aurelia-templating.js @@ -1328,7 +1328,7 @@ export class View { this.bindings.push(binding); if (this.isBound) { - binding.bind(this.bindingContext); + binding.bind(this); } } @@ -1346,9 +1346,6 @@ export class View { this.isBound = false; this.resources._invokeHook('beforeUnbind', this); - this.bindingContext = null; - this.overrideContext = null; - if (this.controller !== null) { this.controller.unbind(); } @@ -1367,6 +1364,9 @@ export class View { for (i = 0, ii = children.length; i < ii; ++i) { children[i].unbind(); } + + this.bindingContext = null; + this.overrideContext = null; } } @@ -3691,7 +3691,9 @@ export class BindableProperty { } this.attribute = this.attribute || _hyphenate(this.name); - this.defaultBindingMode = this.defaultBindingMode || bindingMode.oneWay; + if (this.defaultBindingMode === null || this.defaultBindingMode === undefined) { + this.defaultBindingMode = bindingMode.oneWay; + } this.changeHandler = this.changeHandler || null; this.owner = null; this.descriptor = null; diff --git a/dist/commonjs/aurelia-templating.js b/dist/commonjs/aurelia-templating.js index 0cc883b8..72c9edc8 100644 --- a/dist/commonjs/aurelia-templating.js +++ b/dist/commonjs/aurelia-templating.js @@ -908,7 +908,7 @@ var View = exports.View = function () { this.bindings.push(binding); if (this.isBound) { - binding.bind(this.bindingContext); + binding.bind(this); } }; @@ -923,9 +923,6 @@ var View = exports.View = function () { this.isBound = false; this.resources._invokeHook('beforeUnbind', this); - this.bindingContext = null; - this.overrideContext = null; - if (this.controller !== null) { this.controller.unbind(); } @@ -944,6 +941,9 @@ var View = exports.View = function () { for (i = 0, ii = children.length; i < ii; ++i) { children[i].unbind(); } + + this.bindingContext = null; + this.overrideContext = null; } }; @@ -2962,7 +2962,9 @@ var BindableProperty = exports.BindableProperty = function () { } this.attribute = this.attribute || _hyphenate(this.name); - this.defaultBindingMode = this.defaultBindingMode || _aureliaBinding.bindingMode.oneWay; + if (this.defaultBindingMode === null || this.defaultBindingMode === undefined) { + this.defaultBindingMode = _aureliaBinding.bindingMode.oneWay; + } this.changeHandler = this.changeHandler || null; this.owner = null; this.descriptor = null; diff --git a/dist/es2015/aurelia-templating.js b/dist/es2015/aurelia-templating.js index 77f03a6e..2620b175 100644 --- a/dist/es2015/aurelia-templating.js +++ b/dist/es2015/aurelia-templating.js @@ -781,7 +781,7 @@ export let View = class View { this.bindings.push(binding); if (this.isBound) { - binding.bind(this.bindingContext); + binding.bind(this); } } @@ -796,9 +796,6 @@ export let View = class View { this.isBound = false; this.resources._invokeHook('beforeUnbind', this); - this.bindingContext = null; - this.overrideContext = null; - if (this.controller !== null) { this.controller.unbind(); } @@ -817,6 +814,9 @@ export let View = class View { for (i = 0, ii = children.length; i < ii; ++i) { children[i].unbind(); } + + this.bindingContext = null; + this.overrideContext = null; } } @@ -2734,7 +2734,9 @@ export let BindableProperty = class BindableProperty { } this.attribute = this.attribute || _hyphenate(this.name); - this.defaultBindingMode = this.defaultBindingMode || bindingMode.oneWay; + if (this.defaultBindingMode === null || this.defaultBindingMode === undefined) { + this.defaultBindingMode = bindingMode.oneWay; + } this.changeHandler = this.changeHandler || null; this.owner = null; this.descriptor = null; diff --git a/dist/system/aurelia-templating.js b/dist/system/aurelia-templating.js index 4b4786d2..4e34ab28 100644 --- a/dist/system/aurelia-templating.js +++ b/dist/system/aurelia-templating.js @@ -1383,7 +1383,7 @@ System.register(['aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aurelia- this.bindings.push(binding); if (this.isBound) { - binding.bind(this.bindingContext); + binding.bind(this); } }; @@ -1398,9 +1398,6 @@ System.register(['aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aurelia- this.isBound = false; this.resources._invokeHook('beforeUnbind', this); - this.bindingContext = null; - this.overrideContext = null; - if (this.controller !== null) { this.controller.unbind(); } @@ -1419,6 +1416,9 @@ System.register(['aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aurelia- for (i = 0, ii = children.length; i < ii; ++i) { children[i].unbind(); } + + this.bindingContext = null; + this.overrideContext = null; } }; @@ -3144,7 +3144,9 @@ System.register(['aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aurelia- } this.attribute = this.attribute || _hyphenate(this.name); - this.defaultBindingMode = this.defaultBindingMode || bindingMode.oneWay; + if (this.defaultBindingMode === null || this.defaultBindingMode === undefined) { + this.defaultBindingMode = bindingMode.oneWay; + } this.changeHandler = this.changeHandler || null; this.owner = null; this.descriptor = null; diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 84d29995..57c00ce2 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,13 @@ +### 1.0.0-beta.1.2.1 (2016-03-29) + + +#### Bug Fixes + +* **BindableProperty:** enable specifying oneTime default binding mode ([a557aade](http://github.com/aurelia/templating/commit/a557aade002133144fa2e2106066d26af2037d78), closes [#298](http://github.com/aurelia/templating/issues/298)) +* **View:** preserve bindingContext while unbinding ([ae6feed0](http://github.com/aurelia/templating/commit/ae6feed008ee19dfb0ad9204c562a845c11213ef)) +* **view:** incorrect input to dynamic binding ([2069af08](http://github.com/aurelia/templating/commit/2069af0880057858b7758f67faf4f2f9ccdbc96f)) + + ### 1.0.0-beta.1.2.0 (2016-03-22) diff --git a/package.json b/package.json index 08da0b07..39aa10f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "1.0.0-beta.1.2.0", + "version": "1.0.0-beta.1.2.1", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia",