Add support for templates with leading whitespaces #725

merged 1 commit into from Jul 10, 2016


None yet

2 participants

jozefizso commented Jun 25, 2016 edited


Schema Form templates must have the first DOM child node of type HTMLElement. This prevents us from defining template in <script> tags that are formatted and contain whitespace characters before first HTML element. Schema Form will fail on such templates.

This update will use the firstElementChild property to support templates with leading whitespaces.

<script type="text/ng-template" id="schf-template.html">
scope.form = [{
    type: 'template',
    template: '  <div>{{}}</div>',
    foo: "Hello World"


  • I have read and understand the file
  • I have searched for and linked related issues
  • I have created test cases to ensure quick resolution of the PR is easier
  • I am NOT targeting main branch
  • I did NOT include the dist folder in my PR


@Anthropic Anthropic merged commit c372bae into json-schema-form:development Jul 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment