Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting default options for checkbox type results in error #1836

Closed
Devqon opened this issue Oct 14, 2019 · 3 comments · Fixed by #1838
Closed

Setting default options for checkbox type results in error #1836

Devqon opened this issue Oct 14, 2019 · 3 comments · Fixed by #1838
Labels

Comments

@Devqon
Copy link
Contributor

Devqon commented Oct 14, 2019

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[x] support request

Current behavior
I am trying to override the default setting for the bootstrap checkbox type in the module declaration. This results in an formly/angular error: 'Error: No component factory found for undefined'. Not sure if I don't do it the correct way or that it is a bug.

Expected behavior
The default options can be overriden from the module.

Minimal reproduction of the problem with instructions

     FormlyModule.forRoot( {
      types: [
        {
          name: 'checkbox',
          defaultOptions: {
            templateOptions: {
              indeterminate: false
            }
          }
        }
      ]
    }),

See https://stackblitz.com/edit/ngx-formly-bootstrap-scp5pb

What is the motivation / use case for changing the behavior?
The bootstrap checkbox is defaulted to 'indeterminate', as seen here. I want to configure it default as not indeterminate.

Please tell us about your environment:
Not applicable

  • Angular version: 2.0.X
    7.x

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    all

  • Node (for AoT issues): node --version =
    Not applicable

@vishnu-dev
Copy link

I checked it with material, it works.

@Devqon
Copy link
Contributor Author

Devqon commented Oct 14, 2019

Awesomely quick, thank you!

@aitboudad
Copy link
Member

the fix is now part of v5.5.1 release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants