Package Exports
- ngx-dynamic-form
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ngx-dynamic-form) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ngx-terra-dynamic-form
We noticed that for projects like a portal / dashboard developers need to create several forms again and again. So we thought of something that could make it much more easier and leaving our html code cleaner and we came up with this. This library takes in a json file and gives you a form, so you dont need to create any forms in your projects anymore
Installation
To install this library, run:
$ npm install ngx-dynamic-form --save
Consuming your library
You can import your library in any Angular application by running:
$ npm install ngx-dynamic-form
and then from your Angular AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import your library
import { DynamicFormModule } from 'ngx-dynamic-form';
import { NgDatepickerModule } from 'ng2-datepicker'; //for dates
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
DynamicFormModule,
NgDatepickerModule
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Once your library is imported, you can use its components in your Angular application:
<!-- You can now use your library component in app.component.html -->
<h1>
{{title}}
</h1>
<dynamic-form #dynamicFormName='dynamicForm' [config]='dynamicFormConfig' (submit)='doSomethingCool($event)'></dynamic-form>
In your app.component.ts file you can now create your config
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
queryConfig = [
{
type: 'input',
Group: [
{
type: 'input',
divClass: 'col-lg-10',
inputType: 'text',
class: 'form-control',
name: 'query',
placeholder: 'Search for Anything'
},
{
type: 'input',
divClass: 'col-lg-2',
text: 'Search',
inputType: 'submit',
class: 'btn btn-dcb-info',
name: 'submit',
}
]
}
];
}
Development
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint