Comments (4)
Hi, I'll take a look :)
from angular2-mdl.
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.
@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.
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)
- Angular 5 npm package version. HOT 2
- Extended color schemes HOT 1
- Cannot style input in mdl-textfield HOT 1
- Version 10 of node.js has been released
- [Feature Request] Support for angular v6
- MdlDialog problem after close dialog by clicking outside HOT 1
- Mdl dialog create 2 mdl-backdrop-overlay's HOT 2
- Angular 8 compatibility HOT 6
- An in-range update of @angular/cli is breaking the build 🚨 HOT 1
- An in-range update of @angular-devkit/build-angular is breaking the build 🚨 HOT 1
- An in-range update of @angular-devkit/build-ng-packagr is breaking the build 🚨 HOT 1
- An in-range update of @angular-devkit/build-ng-packagr is breaking the build 🚨 HOT 1
- An in-range update of @types/node is breaking the build 🚨 HOT 28
- An in-range update of @angular-devkit/build-angular is breaking the build 🚨 HOT 15
- [Bug] MdlSelectComponent. Error after view destroy HOT 1
- An in-range update of @types/node is breaking the build 🚨 HOT 10
- An in-range update of ng-packagr is breaking the build 🚨 HOT 5
- An in-range update of @angular-devkit/build-angular is breaking the build 🚨 HOT 5
- Ripple effect in Angular 10
- Angular 10: Invalid peerDependencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2-mdl.