diff --git a/bower.json b/bower.json
index ea03bb9..f8f61cb 100644
--- a/bower.json
+++ b/bower.json
@@ -6,7 +6,7 @@
"Mohammed Basheer"
],
"description": "Angular-Chips is the angular based component. You can use it to add dynamic chips",
- "main": "./dist/angular-chips.min.js",
+ "main": "./dist/angular-chips.js",
"keywords": [
"angular",
"chips",
@@ -33,6 +33,9 @@
"angular-mocks": "1.4.8"
},
"dependencies": {
- "angular": "~1.4.8"
+ "angular": "v1.5.5"
+ },
+ "resolutions": {
+ "angular": "v1.5.5"
}
}
diff --git a/dist/angular-chips.js b/dist/angular-chips.js
index c25af29..a1e14fe 100644
--- a/dist/angular-chips.js
+++ b/dist/angular-chips.js
@@ -163,7 +163,10 @@
/*Extract the chip-tmpl and compile inside the chips directive scope*/
var rootDiv = angular.element('
');
- var tmpl = iElement.find('chip-tmpl').remove();
+ var tmplStr = iElement.html();
+ tmplStr = tmplStr.substr(tmplStr.indexOf('')-('').length);
+ iElement.find('chip-tmpl').remove();
+ var tmpl = angular.element(tmplStr);
var chipTextNode, chipBindedData, chipBindedDataSuffix;
tmpl.attr('ng-repeat', 'chip in chips.list track by $index');
tmpl.attr('ng-class', '{\'chip-failed\':chip.isFailed}')
@@ -240,6 +243,7 @@
template: ''
}
+
};
/* tag is mandatory added validation to confirm that*/
function validation(element) {
diff --git a/dist/angular-chips.min.js b/dist/angular-chips.min.js
index 6866f67..de7db23 100644
--- a/dist/angular-chips.min.js
+++ b/dist/angular-chips.min.js
@@ -1 +1 @@
-!function(){function e(e){return e&&angular.isFunction(e.then)}function n(e){return{add:function(n){var t=angular.copy(e.$modelValue)||[];t.push(n),e.$setViewValue(t)},"delete":function(n){var t=angular.copy(e.$modelValue);t.splice(n,1),e.$setViewValue(t)},deleteByValue:function(n){var t,i;for(t=0;te?l.chips.list.length-1:e>l.chips.list.length-1?0:e}}if(""!==(error=o(a)))throw error;var f=n(s),h=u.hasOwnProperty("defer"),v=i(u.render);l.chips.list,l.chips.addChip=function(n){function i(e){l.chips.list.push(e),f.add(e)}var r,o;void 0!==l.render&&""!==v?(o={},o[v]=n,r=l.render(o)):r=n,e(r)?(r.then(function(e){f.add(e)}),l.chips.list.push(new t(n,r)),l.$apply()):i(r)},l.chips.deleteChip=function(e){var n=l.chips.list.splice(e,1)[0];return n.isFailed?void l.$apply():void(n instanceof t?f.deleteByValue(n.defer):f["delete"](e))},s.$render=function(){if(h&&s.$modelValue){var e,n=[];for(e=0;e"),C=a.find("chip-tmpl").remove();C.attr("ng-repeat","chip in chips.list track by $index"),C.attr("ng-class","{'chip-failed':chip.isFailed}"),C.attr("tabindex","-1"),C.attr("index","{{$index+1}}"),g.append(C);var $=r(g)(l);a.prepend($),a.on("click",function(e){"CHIPS"===e.target.nodeName&&a.find("input")[0].focus()}),a.find("input").on("focus",function(){m=null}),l.chips.handleKeyDown=function(e){function n(){var n=parseInt(document.activeElement.getAttribute("index"))||(t=a.find("chip-tmpl")).length;t=a.find("chip-tmpl"),t[n-1].focus(),m=p(n-1),"INPUT"!==e.target.nodeName&&t[m(e.keyCode)].focus()}if(!("INPUT"!==e.target.nodeName&&"CHIP-TMPL"!==e.target.nodeName||0===a.find("chip-tmpl").length&&""===e.target.value)){var t;if(8===e.keyCode){if("INPUT"===e.target.nodeName&&""===e.target.value)n(),e.preventDefault();else if("CHIP-TMPL"===e.target.nodeName){var i=a.find("chip-tmpl");i.length>0&&parseInt(e.target.getAttribute("index"))-1===i.length&&a.find("chip-tmpl")[m(37)].focus()}}else 37!==e.keyCode&&39!==e.keyCode||(null===m?n():a.find("chip-tmpl")[m(e.keyCode)].focus())}},a.on("keydown",l.chips.handleKeyDown),c(a).addClass("chip-out-focus")}return a.$inject=["scope","iElement","iAttrs","ngModelCtrl","transcludefn"],{restrict:"E",scope:{render:"&?"},transclude:!0,require:"ngModel",link:a,controller:"chipsController",controllerAs:"chips",template:""}}function o(e){return 0===e.find("chip-tmpl").length?"should have chip-tmpl":e.find("chip-tmpl").length>1?"should have only one chip-tmpl":""}function l(e,n,t){this.setFocus=function(e){e?t(n).removeClass("chip-out-focus").addClass("chip-in-focus"):t(n).removeClass("chip-in-focus").addClass("chip-out-focus")},this.removeChip=function(e,n){this.deleteChip(n)}}r.$inject=["$compile","$timeout","DomUtil"],l.$inject=["$scope","$element","DomUtil"],angular.module("angular.chips",[]).directive("chips",r).controller("chipsController",l)}(),function(){function e(){return{restrict:"E",transclude:!0,link:function(e,n,t,i,r){r(e,function(e){n.append(e)}),n.on("keydown",function(n){8===n.keyCode&&(e.$broadcast("chip:delete"),n.preventDefault())})}}}angular.module("angular.chips").directive("chipTmpl",e)}(),function(){function e(){return{restrict:"A",require:"^?chips",link:function(e,n,t,i){function r(e,n){var t;if(n.search("\\(")>0&&(n=n.substr(0,n.search("\\("))),void 0!==n)if(n.split(".").length>1){var i=n.split(".");t=e;for(var r=0;re?l.chips.list.length-1:e>l.chips.list.length-1?0:e}}if(""!==(error=o(a)))throw error;var f=n(s),h=u.hasOwnProperty("defer"),m=i(u.render);l.chips.list,l.chips.addChip=function(n){function i(e){l.chips.list.push(e),f.add(e)}var r,o;void 0!==l.render&&""!==m?(o={},o[m]=n,r=l.render(o)):r=n,e(r)?(r.then(function(e){f.add(e)}),l.chips.list.push(new t(n,r)),l.$apply()):i(r)},l.chips.deleteChip=function(e){var n=l.chips.list.splice(e,1)[0];return n.isFailed?void l.$apply():void(n instanceof t?f.deleteByValue(n.defer):f["delete"](e))},s.$render=function(){if(h&&s.$modelValue){var e,n=[];for(e=0;e"),C=a.html();C=C.substr(C.indexOf("")-"".length),a.find("chip-tmpl").remove();var $=angular.element(C);$.attr("ng-repeat","chip in chips.list track by $index"),$.attr("ng-class","{'chip-failed':chip.isFailed}"),$.attr("tabindex","-1"),$.attr("index","{{$index+1}}"),g.append($);var y=r(g)(l);a.prepend(y),a.on("click",function(e){"CHIPS"===e.target.nodeName&&a.find("input")[0].focus()}),a.find("input").on("focus",function(){v=null}),l.chips.handleKeyDown=function(e){function n(){var n=parseInt(document.activeElement.getAttribute("index"))||(t=a.find("chip-tmpl")).length;t=a.find("chip-tmpl"),t[n-1].focus(),v=p(n-1),"INPUT"!==e.target.nodeName&&t[v(e.keyCode)].focus()}if(!("INPUT"!==e.target.nodeName&&"CHIP-TMPL"!==e.target.nodeName||0===a.find("chip-tmpl").length&&""===e.target.value)){var t;if(8===e.keyCode){if("INPUT"===e.target.nodeName&&""===e.target.value)n(),e.preventDefault();else if("CHIP-TMPL"===e.target.nodeName){var i=a.find("chip-tmpl");i.length>0&&parseInt(e.target.getAttribute("index"))-1===i.length&&a.find("chip-tmpl")[v(37)].focus()}}else 37!==e.keyCode&&39!==e.keyCode||(null===v?n():a.find("chip-tmpl")[v(e.keyCode)].focus())}},a.on("keydown",l.chips.handleKeyDown),c(a).addClass("chip-out-focus")}return a.$inject=["scope","iElement","iAttrs","ngModelCtrl","transcludefn"],{restrict:"E",scope:{render:"&?"},transclude:!0,require:"ngModel",link:a,controller:"chipsController",controllerAs:"chips",template:""}}function o(e){return 0===e.find("chip-tmpl").length?"should have chip-tmpl":e.find("chip-tmpl").length>1?"should have only one chip-tmpl":""}function l(e,n,t){this.setFocus=function(e){e?t(n).removeClass("chip-out-focus").addClass("chip-in-focus"):t(n).removeClass("chip-in-focus").addClass("chip-out-focus")},this.removeChip=function(e,n){this.deleteChip(n)}}r.$inject=["$compile","$timeout","DomUtil"],l.$inject=["$scope","$element","DomUtil"],angular.module("angular.chips",[]).directive("chips",r).controller("chipsController",l)}(),function(){function e(){return{restrict:"E",transclude:!0,link:function(e,n,t,i,r){r(e,function(e){n.append(e)}),n.on("keydown",function(n){8===n.keyCode&&(e.$broadcast("chip:delete"),n.preventDefault())})}}}angular.module("angular.chips").directive("chipTmpl",e)}(),function(){function e(){return{restrict:"A",require:"^?chips",link:function(e,n,t,i){function r(e,n){var t;if(n.search("\\(")>0&&(n=n.substr(0,n.search("\\("))),void 0!==n)if(n.split(".").length>1){var i=n.split(".");t=e;for(var r=0;r');
- var tmpl = iElement.find('chip-tmpl').remove();
+ var tmplStr = iElement.html();
+ tmplStr = tmplStr.substr(tmplStr.indexOf('')-('').length);
+ iElement.find('chip-tmpl').remove();
+ var tmpl = angular.element(tmplStr);
var chipTextNode, chipBindedData, chipBindedDataSuffix;
tmpl.attr('ng-repeat', 'chip in chips.list track by $index');
tmpl.attr('ng-class', '{\'chip-failed\':chip.isFailed}')
@@ -237,6 +240,7 @@
template: ''
}
+
};
/* tag is mandatory added validation to confirm that*/
function validation(element) {