McNull / angular-form-gen

Design Bootstrap based form schemas for AngularJS in a drag and drop WYSIWYG environment.
MIT License
135 stars 81 forks source link

Successfully upgraded to 1.3.13 #7

Open JoeGrasso opened 9 years ago

JoeGrasso commented 9 years ago

Here are the changes I made to upgrade to 1.3.13:

I. Change the interpolateFn property:

     //1.3.13
          var parts = interpolateFn.expressions;          
     //1.2.x
         //var parts = interpolateFn.parts;

Per the docs:

$interpolate: due to 88c2193c, the function returned by $interpolate no longer has a .parts array set on it. Instead it has two arrays:

.expressions, -> an array of the expressions in the interpolated text. The expressions are parsed with $parse, with an extra layer converting them to strings when computed

.separators, -> an array of strings representing the separations between interpolations in the text. This array is always 1 item longer than the .expressions array for easy merging with it


II. Change the $templateCache's ng-pattern:

$templateCache.put
     ....

          // 1.2.x
          ng-pattern=\"/{{ field.schema.validation.pattern }}/\"

          // 1.3.13
          pattern="{{ field.schema.validation.pattern }}"
     ....

Note: I have not upgraded the code to reflect the new $validator for 1.3 form validation.

Hope this helps.

JoeyHoutenbos commented 9 years ago

@McNull can you please upgrade to Angular 1.3.x ?!

spee65 commented 9 years ago

this will be great, The fixes abouve helps, but doesnt full functional