question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I want to use radio buttons. but I can’t get model value…

This is my code:

        <div class="form-group row">
          <label class="col-sm-2 form-control-label">gender</label>
          <div class="col-sm-10 btn-group" [(ngModel)]="gender" ngbRadioGroup name="gender" ngDefaultControl>
            <label class="btn btn-primary">
              <input type="radio" value="M" name="gender"> Male
            </label>
            <label class="btn btn-primary">
              <input type="radio" value="F" name="gender"> Female
            </label>
          </div>
          <em>gender: {{gender}}</em>
        </div>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ehdwns980416commented, Jul 25, 2017

@scttcper in that example they use ngModel in div elements. https://ng-bootstrap.github.io/#/components/buttons/examples

0reactions
cgaravitocommented, Oct 26, 2017

@alobban You are using the old version of ng-bootstrap. The problem is that no found the module NgbRadio, because the your version don’t have.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 2 two way binding using ngModel is not working
The answer that helped me: The directive [(ngModel)]= not working anymore in rc5. To sum it up: input fields now require property name...
Read more >
Angular 4 ngModel binding not work?
I tried many ways to get a two-way binding, not work. Seems Mdb not support Angular 4 ... To use ngModel, should import...
Read more >
Angular—Can't Bind to ngModel, Not a Known Property of input
The downside is that you have to use import statements to load the parts your component needs. The only reason that the ngModel...
Read more >
Can't bind to 'ngModel' since it isn't a known property of 'ng ...
I'm trying to use the official example, but I can not make it work. The example and the page not load. This error...
Read more >
Angular error Can't bind to 'ngModel' since it isn't a ... - YouTube
Learn Angular in Mumbai offline http://stepbystepschools.net/For more such videos visit http://www.questpond.comSee our other Step by Step ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found