Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@covalent/dynamic-forms

Package Overview
Dependencies
Maintainers
3
Versions
285
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@covalent/dynamic-forms

Teradata UI Platform Dynamic Forms Module

  • 0.10.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
654
decreased by-18.86%
Maintainers
3
Weekly downloads
 
Created
Source

td-dynamic-forms

API Summary

Properties:

NameTypeDescription
elements?ITdDynamicElementConfig[]JS Object that will render the elements depending on its config. [name] property is required.
formget(): FormGroupGetter property for dynamic [FormGroup].
validget(): booleanGetter property for [valid] of dynamic [FormGroup].
valueget(): anyGetter property for [value] of dynamic [FormGroup].
errorsget(): {[name: string]: any}Getter property for [errors] of dynamic [FormGroup].
controlsget(): {[key: string]: AbstractControl}Getter property for [controls] of dynamic [FormGroup].

Setup

Import the [CovalentDynamicFormsModule] using the forRoot() method in your NgModule:

import { CovalentDynamicFormsModule } from '@covalent/dynamic-forms';
@NgModule({
  imports: [
    CovalentDynamicFormsModule.forRoot(),
    ...
  ],
  ...
})
export class MyModule {}

Usage

td-dynamic-forms element generates a form dynamically

Pass an array of javascript objects that implement [ITdDynamicElementConfig] with the information to be rendered to the [elements] attribute.

export interface ITdDynamicElementConfig {
  label?: string;
  name: string;
  type: TdDynamicType | TdDynamicElement;
  required?: boolean;
  min?: any;
  max?: any;
  selections?: any[];
  default?: any;
}

Example for HTML usage:

<td-dynamic-forms [elements]="elements">
</td-dynamic-forms>
import { ITdDynamicElementConfig, TdDynamicElement, TdDynamicType } from '@covalent/dynamic-forms';
...
})
export class Demo {
  elements: ITdDynamicElementConfig[] = [{
    name: 'input',
    type: TdDynamicElement.Input,
    required: true,
  }, {
    name: 'slider',
    label: 'Label',
    type: TdDynamicElement.Slider,
    required: true,
  }, {
    name: 'boolean',
    type: TdDynamicType.Boolean,
    default: false,
  }, {
    name: 'select',
    type: TdDynamicElement.Select,
    required: true,
    selections: ['A','B','C']
    default: 'A',
  }];
}

Keywords

FAQs

Package last updated on 02 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc