Skip to content

global ngModelOptions ignored when ngModelOptions provided in field definition. #792

Open
@kyse

Description

@kyse

So I have a need to add the tab index a fied resides on to the ngModelOptions so when its time to validate, I can ignore specific validation errors by parsing the errors array, which contains error codes, which in turn contains the array of ngModelController objects specific to that error. I can grab the fields tab from the ngModelController.$options to check the tab it's part of and know if I should ignore it or not.

Problem is I noticed when I add the ngModelOptions property to the field's form definition, it ends up not applying the global formDefaults' ngModelOptions property on it.

I believe the offending spot is under the sfPathProvider, inside the $get method's postProcessFn method.

It parses through obj.keys, and when obj[attr] === undefined, it applies the schemaDefaults (lookup's saved stdForm object) attribute to it. Seems like it would be good to set ngModelOptions property as a merge between the stdForm settings to capture the global form settings, and also pass in the field's for definition specific options if they exist.

Which leads to the inquiry, besides updating the schema forms file to merge the ngModelOptions, is there another way to lookup the form definition settings when all I have is the ngModelController of that field? Also have a need to grab the path somehow.

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