Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Easier way to read schema properties #38

Open
melanke opened this issue Oct 16, 2019 · 0 comments
Open

Easier way to read schema properties #38

melanke opened this issue Oct 16, 2019 · 0 comments

Comments

@melanke
Copy link
Member

melanke commented Oct 16, 2019

I had to make this method to read the content, it should be easier than that:

    get fieldContent() {
      if (typeof this.schema === 'string') {
        const schemaObject = this.value.$schemaSet[this.schema]
        if (schemaObject) {
          return schemaObject
            .build(this.value, this.field)
            .get() as FieldComponent
        }
        return null
      }

      return this.schema
        .build(this.value, this.field)
        .get() as FieldComponent
    }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant