-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
NgbModule.forRoot() breaks 'traditional' style radio buttons #1125
Comments
This is caused by the fact that @pkozlowski-opensource I think we should introduce a selector |
@alex321 you are right, we should probably have a more fine-grained selector... I'm going to look into this issue and your PR tomorrow. |
@pkozlowski-opensource I had a look around and as far as I am aware, we are doing what we should be. Do you think that this might be related to angular in any way? Here's a brief summary that explains my confusion (I am basing it on GeorgeA93's plunker): However, if I use |
This is a nasty one. I spent 2 days for this, since I didn't know it is possible. I am on alpha.20. The standard behavior still doesn't work. I love this library, but I think if we find a component that can break the default usage, we should remove it from the whole package temporary. Btw, It is not a BAN to that component. lol |
We have also spent some time with this issue. Is there a work around for this issue and/or an ETA on when a fix may be available? |
My work around is pretty simple -- exclude ngbRadioButton component. Just create a custom module to include everything but ngbRadioButton. In fact, I think it might be a good idea to do this, just include the ones that you need. Here it is, save you some time.
|
Thanks, worked a treat. |
@pkozlowski-opensource DzmitryShylovich ask why don't you prefix? |
Looks like the culprit is that the provider needs to be provided into the module, not just the directive - see here for a working implementation. I'll file a PR shortly. |
I have spent also quite some time with similar issue. In my case i tried to disable the form group containing the radio buttons. As soon as i import NgbModule, the disabling of the radio buttons breaks. When i remove the import, the radio buttons are disabled. The plunker shows also the problem with setting the value. |
Really nasty! We have spent about 1 week and finally find out this culprit. |
@maxisam |
@changLiuUNSW we will remove default matching on radios before beta (hopefully or of 2-3 next releases). For now you can just skip importing this particular module in your app. |
..... I came here for setting default value for radio? Now that mean we need choose side for using angular4 or ng bootstrap ? LOL |
@jinwyp So the whole component should be excluded until the issue is fixed |
when I update to 1.0.0-alpha.27,It was suddenly able to run, But not for a while 。I wanna know I , is this fixed? |
Bug description:
I am attempting to use 'traditional' style radio buttons, i.e the radio's you can see here
The plunker below shows that these radio's do not work when NgbModule.forRoot() has been called.
You can still interact with the radios, however they do not show the initial value of the model.
Link to minimally-working plunker that reproduces the issue: http://plnkr.co/edit/6BTqmJESmtsjWGwgUuo0?p=preview
Version of Angular, ng-bootstrap, and Bootstrap:
Angular: 2.0.0
ng-bootstrap: 1.0.0-alpha.14
Bootstrap: 4.0.0-alpha.5
The text was updated successfully, but these errors were encountered: