Giter Site home page Giter Site logo

Comments (4)

mseemann avatar mseemann commented on May 12, 2024

Hi, I'll take a look :)

from angular2-mdl.

mseemann avatar mseemann commented on May 12, 2024

This was really a big problem. I needed to refactor the complete radio button handling. If i release it (tomorrow) your code will be:

<mdl-radio name="group1" formControlName="group1" value="1" >1</mdl-radio>
<mdl-radio name="group1" formControlName="group1" value="2" >1</mdl-radio>
<mdl-radio name="group1" formControlName="group1" value="3" >1</mdl-radio>
public group1 = new FormControl('1');

    this.form = this.fb.group({
      'group1': this.group1
    });

The name attribute can be omitted it is automatically derived form the formControlName.

This example (http://mseemann.io/angular2-mdl/reactiveForms) will be update soon to show how to use the mdl-radio component with reactive forms.

from angular2-mdl.

pauljlucas avatar pauljlucas commented on May 12, 2024

@mseemann How will this work if i want to have 2 different sets of distinct radio buttons? Im assuming then you would not be able to omit name and then name would separate the 2?

I saw you had to add in all of the toggled and untoggled logic, that looked like a pain!

Also, i think i forgot to mention this on the first comment but is there logic for a drop down list (a normal use case is for a list of countries)?

from angular2-mdl.

mseemann avatar mseemann commented on May 12, 2024

hi, yes the name is used to separate the 2 radio groups. But the name will be taken from the formControlName and they must be different if you have more than one group. I have extended the example (http://mseemann.io/angular2-mdl/reactiveForms) with two radio groups. In these example you can remove the name safely.

drop down list: unfortunately there is no drop down list in material design lite (v1.2). That's why i don't want to add one because it would break the usage of the original css. May be this project is a starting point for you (https://github.com/Garbee/Dropdown-Component) to create your own one.

-> all updates in npm v 1.4.6

from angular2-mdl.

Related Issues (20)

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.