1

angular-xeditable: Im trying to find builtin input and output data filter. I'v only found validator onbeforesave, onaftersave etc. But it is only validator, if I will change $data, it will not be saved.

Do you have any idea how to do input and output data filtering using xeditable?

1 Answer 1

1

There is no builtin methods. The best way is to use not minified version of plugin, search for line:

self.save

and

self.show

And add extra lines, it would be great if someone had added filter functions to the plugin.

In my case it is:

self.save = function() {
  var myData = angular.copy(self.scope.$data);
  myData = myData.replace(/(?:\r\n|\r|\n)/g, '<br />');

  valueGetter.assign($scope.$parent, myData); 
};

insteed of:

self.save = function() {
     valueGetter.assign($scope.$parent, angular.copy(self.scope.$data));   
};
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.