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.

Problem to bind [(ngModel)] in <md-radio-group> highlight at startup fails with class attribute

See original GitHub issue

Hey people,

I’m using Angular Material beta 7, and I have a component with the following code snippet

{{question.answer}}
<md-radio-group [(ngModel)]="question.answer" name="question{{i}}">
               <div id="problem" *ngFor="let alternative of question.alternatives" class="my-class">
                  <md-radio-button [value]="alternative.id">
                    {{alternative.title}}
                  </md-radio-button>
                  <div>remove<div>
                </div>
</md-radio-group>

if the div#problem has class attribute the [(ngModel)]="question.answer" in md-radio-group doesn’t bind when the component is started, see below behavior when div#problem does not have class attribute:

example2

But if I add class attribute, the bind does not work when the component is started.

example1

Demo: http://plnkr.co/edit/k3xXPY?p=preview

Simulate the problem when you add and remove class in div#problem

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
GustavoCostaWcommented, Jun 23, 2017

Closing this issue because it’s apparently a bug in the Angular Flex Layout

Check: https://github.com/angular/flex-layout/issues/322

Thank you @willshowell

0reactions
angular-automatic-lock-bot[bot]commented, Sep 5, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default radio button select value angular material 2
In my case the selection issue has been resolved by replacing the name="howLong" attribute with [ngModelOptions]="{standalone: true}" .
Read more >
Can't bind to 'ngModel' since it isn't a known property of 'input'
To fix Can't bind to 'ngModel' since it isn't a known property of 'input' error in Angular we have to import FormsModule in...
Read more >
Can't bind to 'ngModel' since it isn't a known property of 'input ...
https://codedocu.com/Software/Angular/Angular- Error /Angular- Error -NG8002_colon_-Cant- bind -to- ngModel -since-it-isnt-a-known- property -of- ...
Read more >
angular/material2 - Gitter
EXCEPTION: Error in ./CreateQuestion class CreateQuestion - inline template:17:0 caused by: md-input-container must contain an mdInput directive.
Read more >
Angular Material Interview Questions & Answers - Wisdom Jobs
ng-model : Assignable angular expression to data-bind to. name: Property name ... a child. md-input-container also supports error handling using the standard ...
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