diff --git a/src/js/anot-touch.js b/src/js/anot-touch.js index c4c6ef1..c9c624c 100644 --- a/src/js/anot-touch.js +++ b/src/js/anot-touch.js @@ -3361,6 +3361,8 @@ const _Anot = (function() { function getOptionsFromTag(elem, vmodels) { var attributes = aslice.call(elem.attributes, 0) var ret = {} + var vm = vmodels[0] || {} + for (var i = 0, attr; (attr = attributes[i++]); ) { var name = attr.name if ( @@ -3376,9 +3378,7 @@ const _Anot = (function() { var camelizeName = camelize(name) if (camelizeName.indexOf('@') === 0) { camelizeName = camelizeName.slice(1) - var vm = vmodels[0] if ( - vm && vm.hasOwnProperty(attr.value) && typeof vm[attr.value] === 'function' ) { @@ -4077,7 +4077,7 @@ const _Anot = (function() { var outer = (binding.includeReplace = !!Anot(elem).data( 'includeReplace' )) - if (Anot(elem).data('includeCache')) { + if (Anot(elem).data('cache')) { binding.templateCache = {} } binding.start = DOC.createComment(':include') @@ -4098,15 +4098,17 @@ const _Anot = (function() { var obj = {} var vm = this.vmodels[0] + val = toJson(val) + if (this.param) { if (typeof val === 'object' && val !== null) { if (Array.isArray(val)) { - obj[this.param] = val.$model || val + obj[this.param] = val } else { if (Date.isDate(val)) { obj[this.param] = val.toUTCString() } else { - obj[this.param] = val.$model || val + obj[this.param] = val } } } else { @@ -4120,7 +4122,7 @@ const _Anot = (function() { return } - obj = val.$model || val + obj = val } for (var i in obj) { diff --git a/src/js/anot-touch.shim.js b/src/js/anot-touch.shim.js index 77e51af..c8edeeb 100644 --- a/src/js/anot-touch.shim.js +++ b/src/js/anot-touch.shim.js @@ -3376,6 +3376,8 @@ function getOptionsFromTag(elem, vmodels) { var attributes = aslice.call(elem.attributes, 0) var ret = {} + var vm = vmodels[0] || {} + for (var i = 0, attr; (attr = attributes[i++]); ) { var name = attr.name if ( @@ -3391,9 +3393,7 @@ var camelizeName = camelize(name) if (camelizeName.indexOf('@') === 0) { camelizeName = camelizeName.slice(1) - var vm = vmodels[0] if ( - vm && vm.hasOwnProperty(attr.value) && typeof vm[attr.value] === 'function' ) { @@ -4092,7 +4092,7 @@ var outer = (binding.includeReplace = !!Anot(elem).data( 'includeReplace' )) - if (Anot(elem).data('includeCache')) { + if (Anot(elem).data('cache')) { binding.templateCache = {} } binding.start = DOC.createComment(':include') @@ -4113,15 +4113,17 @@ var obj = {} var vm = this.vmodels[0] + val = toJson(val) + if (this.param) { if (typeof val === 'object' && val !== null) { if (Array.isArray(val)) { - obj[this.param] = val.$model || val + obj[this.param] = val } else { if (Date.isDate(val)) { obj[this.param] = val.toUTCString() } else { - obj[this.param] = val.$model || val + obj[this.param] = val } } } else { @@ -4135,7 +4137,7 @@ return } - obj = val.$model || val + obj = val } for (var i in obj) { diff --git a/src/js/anot.js b/src/js/anot.js index 668c3e0..322fb76 100644 --- a/src/js/anot.js +++ b/src/js/anot.js @@ -3361,6 +3361,8 @@ const _Anot = (function() { function getOptionsFromTag(elem, vmodels) { var attributes = aslice.call(elem.attributes, 0) var ret = {} + var vm = vmodels[0] || {} + for (var i = 0, attr; (attr = attributes[i++]); ) { var name = attr.name if ( @@ -3376,9 +3378,7 @@ const _Anot = (function() { var camelizeName = camelize(name) if (camelizeName.indexOf('@') === 0) { camelizeName = camelizeName.slice(1) - var vm = vmodels[0] if ( - vm && vm.hasOwnProperty(attr.value) && typeof vm[attr.value] === 'function' ) { @@ -4077,7 +4077,7 @@ const _Anot = (function() { var outer = (binding.includeReplace = !!Anot(elem).data( 'includeReplace' )) - if (Anot(elem).data('includeCache')) { + if (Anot(elem).data('cache')) { binding.templateCache = {} } binding.start = DOC.createComment(':include') @@ -4098,15 +4098,17 @@ const _Anot = (function() { var obj = {} var vm = this.vmodels[0] + val = toJson(val) + if (this.param) { if (typeof val === 'object' && val !== null) { if (Array.isArray(val)) { - obj[this.param] = val.$model || val + obj[this.param] = val } else { if (Date.isDate(val)) { obj[this.param] = val.toUTCString() } else { - obj[this.param] = val.$model || val + obj[this.param] = val } } } else { @@ -4120,7 +4122,7 @@ const _Anot = (function() { return } - obj = val.$model || val + obj = val } for (var i in obj) { diff --git a/src/js/anot.shim.js b/src/js/anot.shim.js index dfeb88e..1b6be2f 100644 --- a/src/js/anot.shim.js +++ b/src/js/anot.shim.js @@ -3376,6 +3376,8 @@ function getOptionsFromTag(elem, vmodels) { var attributes = aslice.call(elem.attributes, 0) var ret = {} + var vm = vmodels[0] || {} + for (var i = 0, attr; (attr = attributes[i++]); ) { var name = attr.name if ( @@ -3391,9 +3393,7 @@ var camelizeName = camelize(name) if (camelizeName.indexOf('@') === 0) { camelizeName = camelizeName.slice(1) - var vm = vmodels[0] if ( - vm && vm.hasOwnProperty(attr.value) && typeof vm[attr.value] === 'function' ) { @@ -4092,7 +4092,7 @@ var outer = (binding.includeReplace = !!Anot(elem).data( 'includeReplace' )) - if (Anot(elem).data('includeCache')) { + if (Anot(elem).data('cache')) { binding.templateCache = {} } binding.start = DOC.createComment(':include') @@ -4113,15 +4113,17 @@ var obj = {} var vm = this.vmodels[0] + val = toJson(val) + if (this.param) { if (typeof val === 'object' && val !== null) { if (Array.isArray(val)) { - obj[this.param] = val.$model || val + obj[this.param] = val } else { if (Date.isDate(val)) { obj[this.param] = val.toUTCString() } else { - obj[this.param] = val.$model || val + obj[this.param] = val } } } else { @@ -4135,7 +4137,7 @@ return } - obj = val.$model || val + obj = val } for (var i in obj) {