Skip to content

Instantly share code, notes, and snippets.

@bobvawter
Last active March 24, 2016 19:39
Show Gist options
  • Save bobvawter/5c9c8d4f073d6f7a7da1 to your computer and use it in GitHub Desktop.
Save bobvawter/5c9c8d4f073d6f7a7da1 to your computer and use it in GitHub Desktop.
Validation thoughts

If the value != null assertion fails in the leaf component, want the validation root to produce an error object that looks like

{
  "leaf": {
    "inner": {
      "required": true
    }
  }
}
<div validationPath="inner"
[validations]="{required: value != null}"></div>
<div validationRoot #root="validation">
<leaf-component validationPath="leaf">
</leaf-component>
<button [disabled]="!root.valid"></button>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment