4

I am building a form using the awesome angular-schema-form. I am able to create my form schema object quite successfully. I am wanting (hoping) to be able to set all the form components in the schema using the x-schema-form property in the schema object.

I am able to specify the type and the titleMap's for selects all perfectly. However where I am having an issue is assigning a style to the element using the "x-schema-form" - it just seems to be being ignored.

So when I do the following (Note I have the Ionic Framework)

   "x-schema-form": {
      "type": "textarea",
      "style": "item item-input"
   }

The "style" is not getting passed to the form. If I pass the style in the $scope.form [] then I get the style. I am however trying to do this all in the schema as it would be much easier for me to do it in one place due to the nature in which I get the list of form elements.

Any advice on this would be greatly appreciated.

Thanks BrentR

4

1 回答 1

4

所以 asf 实际上根本不支持该style属性,所以目前您正在尝试的内容是不可能的。但是,您可以使用 x-schema-form 应用 a fieldHtmlClass,然后通过 CSS 应用样式。

您可以在文档中阅读有关标准选项的更多信息。https://github.com/Textalk/angular-schema-form/blob/master/docs/index.md#standard-options

于 2015-02-19T07:10:04.677 回答