Skip to content

Add-on ngModel builder seems to not work at all #982

@frikinside

Description

@frikinside

Hi,

I'm using the 1.0.0-alpha.5 version.
I've been trying to make and add-on and follow the documentation step by step but I'm having a problem with the ngModel builder.
Whenever I try to use any of the three options for sf-field-model the DOM don't change and the ngModel directive isn't getting injected.

Expected behaviour

When I set the attribute sf-field-model on an input control I expect that the ngModel builder takes care of it and inject the ng-model directive with the proper binding.
Sample from the docs:
If I set the template like this:

<div>
  <input sf-field-model type="text">
</div>

I expect this result:

<div>
  <input sf-field-model ng-model="model['name']" type="text">
</div>

Actual behaviour

Instead of that I'm getting nothing. I'm getting this:

<div>
  <input sf-field-model type="text">
</div>

Seems like the builder isn't getting triggered to action.
Please see the plunker bellow to check the addon implementation and a sample of the problem.

Gist/Plunker/Demo

I've prepared a simple plunker to show the issue.
Plunker
In that plunker I set the schema with two properties. A simple string and a string with a format to trigger the addon.

Thanks in advance!
Kindly regards.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions