Giter Club home page Giter Club logo

ng-dynamic-forms's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-dynamic-forms's Issues

Support validators for groups

It is not well documented but it is possible to attach a validator to a FormGroup. Particularly useful for the checkbox group to require at least one checkbox in the group be checked. See this SO post for context.

Build issues

I'm including "@ng2-dynamic-forms/core": "1.0.0-alpha.8"

On build i have next error.
[default] ./node_modules/@ng2-dynamic-forms/core/src/service/dynamic-form.service.d.ts:2:34
Cannot find module './dynamic-form.model'.

So I checked npm cache package file npm-cache/@ng2-dynamic-forms/core/1.0.0-alpha.8/package.tgz
so inside of it we have src/service/dynamic-form.service.d.ts and it starts from next lines.
import { FormBuilder } from "@angular/forms";
import { DynamicFormModel } from "./dynamic-form.model";

But correct path to dynamic-form.model should be ../model/dynamic-form.model
and for example dynamic-form-control.component.d.ts has it.

Also I have error that already solved by pull request i sent today.
getting error "Type 'void' is not assignable to type 'FormGroup'" for code " this.form = this.dynamicFormService.createFormGroup(this.dynamicFormModel);" where "form: FormGroup;"

"cannot read property 'emit' of undefined" when focusing a form control

core.umd.js:3433 TypeError: Cannot read property 'emit' of undefined
    at DynamicFormBootstrapComponent.DynamicFormControlComponent.onFocus (core.umd.js:1262)
    at DebugAppView._View_DynamicFormBootstrapComponent22._handle_focus_0_2 (DynamicFormBootstrapComponent.ngfactory.js:3566)
    at core.umd.js:9678
    at platform-browser.umd.js:1813
    at platform-browser.umd.js:1926
    at ZoneDelegate.invoke (zone.js:192)
    at Object.onInvoke (core.umd.js:6220)
    at ZoneDelegate.invoke (zone.js:191)
    at Zone.runGuarded (zone.js:99)
    at NgZoneImpl.runInnerGuarded (core.umd.js:6249)

the error occurs here:

//@ng2-dynamic-forms\core\src\component\dynamic-form-control.component.ts

    onFocus($event: FocusEvent) {

        this.focus.emit($event); //<<< this.focus is undefined, I can't find where it's initialized.
        this.hasFocus = true;

        //@exclude
        console.log($event, this.model.id + " field is focused");
        //@endexclude
    }

rename CheckboxModelConfig to match convention

Hello,

Been working with this package for just under a week now and I'm digging it. Wrote a custom UI module to deal with some additional input types we needed. So first I want to say thanks.

Now the issue:
It seems like CheckboxModelConfig should be DynamicCheckboxModelConfig to match the convention used for the other input model and config types.

Cheers

Webpack support.

If I use webpack there is issue with templates loading.
to make component usable I have to copy templates (in case of bootstrap module it is dynamic-form-bootstrap.component.html) to the root of my application.

Webpack use require statement to load templates and only in this case it parses such files.

Request: make plugin flexible and works both with systemjs like now and allow to use it with webpack.

Controls validation question

Can you provide sample may be in example apphow to use validators with dynamic forms.
So how to extend base form markup to display diferent validation messages.

For example i tried with field having Validators.required attached to text field
and put <div *ngIf="control.dirty && !controlvalid">Invalid</div> inside the template before <span *ngIf="model.help" class="help-block">{{model.help}}</span>
So I getting message in case field empty, but I asking if there more generic solution and how it was planned by developer.

Build issues

I'm including "@ng2-dynamic-forms/core": "1.0.0-alpha.8"

On build i have next error.
[default] ./node_modules/@ng2-dynamic-forms/core/src/service/dynamic-form.service.d.ts:2:34
Cannot find module './dynamic-form.model'.

So I checked npm cache package file npm-cache/@ng2-dynamic-forms/core/1.0.0-alpha.8/package.tgz
so inside of it we have src/service/dynamic-form.service.d.ts and it starts from next lines.
import { FormBuilder } from "@angular/forms";
import { DynamicFormModel } from "./dynamic-form.model";

But correct path to dynamic-form.model should be ../model/dynamic-form.model
and for example dynamic-form-control.component.d.ts has it.

Also I have error that already solved by pull request i sent today.
getting error "Type 'void' is not assignable to type 'FormGroup'" for code " this.form = this.dynamicFormService.createFormGroup(this.dynamicFormModel);" where "form: FormGroup;"

FormArray Within A FormGroup

First of all i must commend you for this great library you have done.
I really appreciate your work and effort.

I am trying to create a formArray with a formGroup. from the samples i can guess the library is expecting the form array at the top level not within a formgroup.
i get an error ORIGINAL EXCEPTION: Cannot find control with path: 'hh_member_names_repeat -> 0,

I will be grateful if you can give me a hint on how i can hack this library to create a fromArray with a FormGroup.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.