vitalets / angular-xeditable

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

two way binding #717

Open KetanJain6333 opened 6 years ago

KetanJain6333 commented 6 years ago

two binding is not supporting in editable-text="", value is binding only after clicking submit button but it should be two way binded as it happen in angularjs.

ckosloski commented 6 years ago

That is a "feature" of angular-xeditable. That is how it was designed. What problem are you trying to solve that would require two-way binding? I will be happy to review any PR's submitted.

KetanJain6333 commented 6 years ago

when i am adding more fields then two way binding is not working. i am printing the arrrayObject( console.log("2wayBinding",$scope.activeModules['settings/customer-profile/get-customer-details'].profileData.contact) ) after clicking the add more field.

Please go through the code code: HTML Code-->

  • {{contacts.title}}
    {{contacts.name}}
    {{contacts.email}}
    {{contacts.number}}

JS Code-->

$scope.addNewChoice = function() {

 $scope.activeModules['settings/customer-profile/get-customer-details'].profileData.contact.push({});

console.log("2wayBinding",$scope.activeModules['settings/customer-profile/get-customer-details'].profileData.contact) };

$scope.removeNewChoice = function(index) { if(index >= 0 && $scope.activeModules['settings/customer-profile/get-customer-details'].profileData.contact.length>1){ $scope.activeModules['settings/customer-profile/get-customer-details'].profileData.contact.splice(index, 1); console.log("index",index) } }


From: ckosloski notifications@github.com Sent: Tuesday, January 30, 2018 3:53:07 PM To: vitalets/angular-xeditable Cc: Ketan Jain; Author Subject: Re: [vitalets/angular-xeditable] two way binding (#717)

That is a "feature" of angular-xeditable. That is how it was designed. What problem are you trying to solve that would require two-way binding? I will be happy to review any PR's submitted.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vitalets/angular-xeditable/issues/717#issuecomment-361775084, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AiSVvRT7zF9GWKOJTozchXsLBdLInaYpks5tP6tjgaJpZM4Rx50H.

ckosloski commented 6 years ago

Can you add a plnkr or jsfiddle showing your issue? I don't quite understand what your issue is. On add, you are logging something and the logging isn't working? Or is the display of the new row not happening on add?

One observation, I think you need to actually add an object on the push, something like:

$scope.addNewChoice = function() { 
$scope.inserted = {
      name: '',
      email: '',
      number: '' 
    };
  $scope.activeModules['settings/customer-profile/get-customer-details'].profileData.contact.push(inserted); 
 };
KetanJain6333 commented 6 years ago

when i type into input box then it should get bind like it does in ng-model angularjs which is called two binding but in editable-text case it didn't get binded.

https://www.w3schools.com/angular/tryit.asp?filename=try_ng_model_two-way ----->want this feature in editable-text="" https://www.w3schools.com/angular/tryit.asp?filename=try_ng_model_two-way Tryit Editor v3.5 - W3Schoolshttps://www.w3schools.com/angular/tryit.asp?filename=try_ng_model_two-way www.w3schools.com Save to Google Drive. If you have a Google account, you can save this code to your Google Drive. Google will ask you to confirm Google Drive access.


From: ckosloski notifications@github.com Sent: Wednesday, January 31, 2018 5:50:31 AM To: vitalets/angular-xeditable Cc: Ketan Jain; Author Subject: Re: [vitalets/angular-xeditable] two way binding (#717)

Can you add a plnkr or jsfiddle showing your issue? I don't quite understand what your issue is. On add, you are logging something and the logging isn't working? Or is the display of the new row not happening on add?

One observation, I think you need to actually add an object on the push, something like:

$scope.addNewChoice = function() { $scope.inserted = { name: '', email: '', number: '' }; $scope.activeModules['settings/customer-profile/get-customer-details'].profileData.contact.push(inserted); };

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vitalets/angular-xeditable/issues/717#issuecomment-361937592, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AiSVvQwfg3qYFCm2d4Nh45naX0asvfvxks5tQG-ngaJpZM4Rx50H.

ckosloski commented 6 years ago

I'm sorry, but angular-xeditable is not setup that way. I can try and help you find a solution to your specific problem if you describe it more or provide a plunkr/jsfiddle.

KetanJain6333 commented 6 years ago

Hi,

Please find the attached screenshot and help us out in implementing this functionality where i want to create a dynamic form on clicking add button and remove the same.

Thanks & Regards Ketan Jain


From: ckosloski notifications@github.com Sent: Thursday, February 1, 2018 6:36:28 AM To: vitalets/angular-xeditable Cc: Ketan Jain; Author Subject: Re: [vitalets/angular-xeditable] two way binding (#717)

I'm sorry, but angular-xeditable is not setup that way. I can try and help you find a solution to your specific problem if you describe it more or provide a plunkr/jsfiddle.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vitalets/angular-xeditable/issues/717#issuecomment-362284226, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AiSVvcYRbcSK2EPK8zpWw9nVw6G0djcEks5tQcvsgaJpZM4Rx50H.

ckosloski commented 6 years ago

There is no image attached. This is the editable row example. Based on your first post, it seems that is what you are trying to do.