Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.

Commit f45810a

Browse files
committed
Added bug fixes in final js file and added licence in readme
1 parent 27eada8 commit f45810a

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,26 @@ Using Promise Markup
7272

7373
<a href="http://codepen.io/mohbasheer/pen/JXKLyY" target="_blank"> <h3 style="margin:0">Edit</h3> </a>
7474
<img src="others/Using_typeahead_example2.gif" style="border: 1px solid #000000">
75+
76+
77+
### MIT License (MIT)
78+
79+
Copyright (c) 2016 Mohammed Basheer (ssp.basheer@gmail.com)
80+
81+
Permission is hereby granted, free of charge, to any person obtaining a copy
82+
of this software and associated documentation files (the "Software"), to deal
83+
in the Software without restriction, including without limitation the rights
84+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
85+
copies of the Software, and to permit persons to whom the Software is
86+
furnished to do so, subject to the following conditions:
87+
88+
The above copyright notice and this permission notice shall be included in all
89+
copies or substantial portions of the Software.
90+
91+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
92+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
94+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
95+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
96+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
97+
SOFTWARE.

dist/angular-chips.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
function ngModel(modelCtrl) {
1616
return {
1717
add: function(val) {
18-
var modelCopy = angular.copy(modelCtrl.$modelValue);
18+
var modelCopy = angular.copy(modelCtrl.$modelValue) || [];
1919
modelCopy.push(val)
2020
modelCtrl.$setViewValue(modelCopy);
2121
},
@@ -135,15 +135,15 @@
135135
* ngModel values are copied when it's updated outside
136136
*/
137137
ngModelCtrl.$render = function() {
138-
if (isDeferFlow) {
138+
if (isDeferFlow && ngModelCtrl.$modelValue) {
139139
var index, list = [];
140140
for (index = 0; index < ngModelCtrl.$modelValue.length; index++) {
141141
// list.push(ngModelCtrl.$modelValue[index]);
142142
list.push(new DeferChip(ngModelCtrl.$modelValue[index]))
143143
}
144144
scope.chips.list = list;
145145
} else {
146-
scope.chips.list = angular.copy(ngModelCtrl.$modelValue);
146+
scope.chips.list = angular.copy(ngModelCtrl.$modelValue) || [];
147147
}
148148

149149
}

dist/angular-chips.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "chips",
2+
"name": "angular-chips",
33
"version": "1.0.0",
44
"description": "",
55
"author": "Mohammed Basheer",

0 commit comments

Comments
 (0)