npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wfw-ngx-formly

v4.2.0

Published

ngx-formly is an Angular 2 module which has a Components to help customize and render JavaScript/JSON configured forms. The formly-form Component and the FormlyConfig service are very powerful and bring unmatched maintainability to your application's form

Downloads

20

Readme

@ngx-formly

Angular Style Guide All Contributors Stories in Ready

Status: Build Status npm version devDependencies Status Package Quality Known Vulnerabilities codecov.io

Links: Gitter PRs Welcome

Ngx Formly is a dynamic JSON powered form library for Angular (mainly based an on Angular Reactive Forms) that bring unmatched maintainability to your application's forms.

Supported UI libs

| UI | | | ------------------------------------------------- | - | | Bootstrap | ✅ | | Ionic | ✅ | | Kendo | ✅ | | Material2 | ✅ | | PrimeNG | ✅ | | NativeScript | ❌ |

Which Version to use?

| Angular version | Formly version | | --------------- | ---------------------- | | Angular >= 6 | @ngx-formly/[email protected] | | Angular >= 5 | @ngx-formly/[email protected] | | Angular >= 4 | @ngx-formly/[email protected] | | Angular >= 2 | [email protected] |

Quick links

Quick Start

Follow these steps to get started with Ngx Formly. Also check out our demos for further examples.

1. Install @angular/forms and @ngx-formly/core packages:

  npm install @angular/forms @ngx-formly/core --save

2. Choose and install your UI (pre-defined types/templates) package:

  • Material2:
    1. Ensure you have already installed material2 https://material.angular.io/guide/getting-started
    2. Install @ngx-formly/material
  npm install @ngx-formly/material --save
  • Bootstrap:

      npm install @ngx-formly/bootstrap --save
  • Ionic:

      npm install @ngx-formly/ionic --save
  • PrimeNG:

      npm install @ngx-formly/primeng --save
  • Kendo:

      npm install @ngx-formly/kendo --save

3. Import the FormlyModule and UI (pre-defined types/templates):

import {NgModule} from '@angular/core';
import {ReactiveFormsModule} from '@angular/forms';
import {FormlyModule} from '@ngx-formly/core';
import {FormlyBootstrapModule} from '@ngx-formly/bootstrap';

// for material2 import `FormlyMaterialModule`:
// import {FormlyMaterialModule} from '@ngx-formly/material';

// for ionic import `FormlyIonicModule`:
// import {FormlyIonicModule} from '@ngx-formly/ionic';

// for primeng import `FormlyPrimeNGModule`:
// import {FormlyPrimeNGModule} from '@ngx-formly/primeng';

// for kendo import `FormlyKendoModule`:
// import {FormlyKendoModule} from '@ngx-formly/kendo';

@NgModule({
  imports: [
    ...,
    ReactiveFormsModule,
    FormlyModule.forRoot(),
    FormlyBootstrapModule,

    // for material2:
    // FormlyMaterialModule

    // for ionic:
    // FormlyIonicModule

    // for primeng:
    // FormlyPrimeNGModule

    // for kendo:
    // FormlyKendoModule
  ],
})
export class AppModule {}

3. Define the form config in your component:

import {Component} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {FormlyFieldConfig} from '@ngx-formly/core';

@Component({
  selector: 'app',
  template: `
    <form [formGroup]="form" (ngSubmit)="submit(model)">
      <formly-form [form]="form" [fields]="fields" [model]="model">
        <button type="submit" class="btn btn-default">Submit</button>
      </formly-form>
    </form>
  `,
})
export class AppComponent {
  form = new FormGroup({});
  model = { email: '[email protected]' };
  fields: FormlyFieldConfig[] = [{
    key: 'email',
    type: 'input',
    templateOptions: {
      type: 'email',
      label: 'Email address',
      placeholder: 'Enter email',
      required: true,
    }
  }];

  submit(model) {
    console.log(model);
  }
}

From there, it's just JavaScript. Allowing for DRY, maintainable, reusable forms.

Roadmap

See the issues labeled enhancement

Thanks

A special thanks to Kent C. Dodds for giving me opportunity to work on this. This library is maintained (with love) by me, Mohammed Zama Khan. Thanks to all contributors! If you're trying to find angular-formly, go here

Contributors

Thanks goes to these wonderful people (emoji key):