vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

TypeError: Object doesn't support property or method 'assign' #410

Closed dannycsng closed 7 years ago

dannycsng commented 8 years ago

I have inherited an application that is using AngularJS 1.2.24 and angular-xeditable - 0.1.8. I am making the Phone editable but each time it gives me the error "TypeError: Object doesn't support property or method 'assign'".

The setting of xeditable field is in html:

            <div class="col-md-4 text-left" ng-show="canChangeInfo" ng-if="phoneNumber == null || phoneNumber.length==0">
                  <span editable-tel="phoneNumber" e-form="telBtnForm" e-required e-pattern="\d{3}\-\d{7}" e-title="xxx-xxxxxxx" e-placeholder="Telephone" onbeforesave="validatephone($data);">
                      <button class="btn btn-primary btn-xs" ng-click="telBtnForm.$show();" ng-hide="telBtnForm.$visible;">edit</button>
                  </span>
             </div>

Controller js: $scope.validatePhone = function (data) { var phoneNum = data.replace("-", "").replace("(", "").replace(")", "").replace(".", ""); if (phoneNum.length < 10) return "Invalid Telephone."; var d = $q.defer(); dataSvc.updateUserTelephone(phoneNum , function (response) { if (response.isSuccess == true) { d.resolve(); } else { d.resolve(response.validationErrors[0]); } }, function (errResponse) { d.reject("updateUserPhoneTrouble"); }); return d.promise; };

I have found many other suggestion like heml id same as var in the js and clean up cookie and cache of the browser. But, none working. Anyone has any idea?

The error occurred as soon as I click on the "check" button:

phonexeditable

ckosloski commented 8 years ago

Your function is defined as "validatePhone" and you are calling "validatephone". Javascript function names are case sensitive.

ckosloski commented 7 years ago

@dannycsng are you still having an issue?

dannycsng commented 7 years ago

Sorry for late response. I believe this issue resolved. thanks.

On Wed, Aug 16, 2017 at 10:01 AM, ckosloski notifications@github.com wrote:

@dannycsng https://github.com/dannycsng are you still having an issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitalets/angular-xeditable/issues/410#issuecomment-322800641, or mute the thread https://github.com/notifications/unsubscribe-auth/AD8uQC_oaCWEcQCNs-vZ_cJy59YkozRFks5sYwRagaJpZM4HKidW .

ckosloski commented 7 years ago

@dannycsng can you go ahead and close the issue please

dannycsng commented 7 years ago

Sorry, this has been awhile and I loss the link to the blog.

On Thu, Sep 21, 2017 at 8:24 AM, ckosloski notifications@github.com wrote:

@dannycsng https://github.com/dannycsng can you go ahead and close the issue please

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitalets/angular-xeditable/issues/410#issuecomment-331155242, or mute the thread https://github.com/notifications/unsubscribe-auth/AD8uQL40D0KS3Od9QiTXYstBK_3TzexPks5skmOrgaJpZM4HKidW .

ckosloski commented 7 years ago

@eugef can you go ahead and close this issue?