Skip to content

Commit

Permalink
Update bootstrap-tagsinput-angular.js
Browse files Browse the repository at this point in the history
for issue 214: maxTags is not working !! in angular version of bootstrap tags input mdbootstrap#214

I modified the Angular directive to use the attributes `maxTags`, `maxChars`, `trimValue`, and `allowDuplicates`.
  • Loading branch information
xper authored Feb 13, 2017
1 parent 41fe4aa commit d77162b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bootstrap-tagsinput-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ angular.module('bootstrap-tagsinput', [])
},
itemValue: getItemProperty(scope, attrs.itemvalue),
itemText : getItemProperty(scope, attrs.itemtext),
maxTags: !isNaN(attrs.maxTags) ? attrs.maxTags : undefined,
maxChars: !isNaN(attrs.maxChars) ? attrs.maxChars : undefined,
trimValue: attrs.trimValue === 'true' ? true : false,
allowDuplicates: attrs.allowDuplicates === 'true' ? true : false,
confirmKeys : getItemProperty(scope, attrs.confirmkeys) ? JSON.parse(attrs.confirmkeys) : [13],
tagClass : angular.isFunction(scope.$parent[attrs.tagclass]) ? scope.$parent[attrs.tagclass] : function(item) { return attrs.tagclass; }
});
Expand Down

0 comments on commit d77162b

Please sign in to comment.