markacola / angular-formly-repeating-section

Repeating sections type for Angular Formly.
3 stars 3 forks source link

Supporting Parsers and Formatters #3

Open blowsie opened 7 years ago

blowsie commented 7 years ago

With the nature of the inputs being inside a ng-repeat, parsers and formattersto not work with the repeat section type..

eg:

  defaultOptions: function defaultRepeatSectionOptions() {
        return {
          parsers: [
            function(modelValue, viewValue, scope) {
              debugger;
              return JSON.parse(viewValue);
            }
          ],
          formatters: [
            function(modelValue, viewValue, scope) {
              debugger;
              return JSON.stringify(modelValue);
            }
          ],
        }
      }

Any thoughts on how the parsers / formatters could be manually / programatically applied?

markacola commented 7 years ago

Sorry @blowsie, I have been away from this for far to long and no longer use angular, so I wouldn't know how to implement this, but I am more that happy to accept a pull request if you want to have a crack at it.