Skip to content

Add support for templates with leading whitespaces #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jozefizso
Copy link
Contributor

@jozefizso jozefizso commented Jun 25, 2016

Description

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">
  <div>{{form.foo}}</div>
</script>
scope.form = [{
    type: 'template',
    template: '  <div>{{form.foo}}</div>',
    foo: "Hello World"
}];

Checklist

  • I have read and understand the CONTRIBUTIONS.md 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

@json-schema-form/angular-schema-form-lead

@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants