Permalink
Browse files

feat(component): hide form-field when element.hidden is true

  • Loading branch information...
bas080
bas080 committed Jul 21, 2016
1 parent 81bd989 commit 7fca3427095f79a94592b7ca1be8a621938fcf7e
Showing with 19 additions and 2 deletions.
  1. +1 −0 doc/SUMMARY.md
  2. +16 −0 doc/element.md
  3. +2 −2 src/component/form-field.html
@@ -5,6 +5,7 @@
* [Quick start](usage.md)
* [Configuration](configuration.md)
* [Terminology](terminology.md)
* [Element](element.md)
* [Schema](schema.md)
* [Types](types.md)
* [Model](model.md)
@@ -0,0 +1,16 @@
# Element

Certain properties on the element are reserved for extra features.

## Attributes

It is possible to set attributes on the input elements. The `attributes`
property is used for this. This allows one to use the html builtin
[input attributes](http://www.w3schools.com/TAGS/tag_input.asp)

## Hidden

In certain cases one would want to hide an element. A usecase where this
applies is when using the `<entity-form>`. One might not have control over the
schema that is generated by the entity-form component. One can however extend
the schema by using a decorator which extends the schema when generating it.
@@ -1,12 +1,12 @@
<template>
<!-- does not have a view model, meaning that it is a html only component -->
<compose
if.bind="!hasViewModel"
if.bind="!hasViewModel && !element.hidden"
view.bind="view"></compose>

<!-- has a view model this is a component with view model -->
<compose
if.bind="hasViewModel"
if.bind="hasViewModel && !element.hidden"
model.bind="{element: element, value: value, message: message}"
view-model.bind="view"></compose>
</template>

0 comments on commit 7fca342

Please sign in to comment.