Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
ampersand-radio-view
Advanced tools
Readme
An extension of ampersand-input-view to create radio buttons.
Adds a "text" property for , and "checked" to indicate if the button should be checked at render time.
npm install ampersand-radio-view
var FormView = require('ampersand-form-view');
var RadioView = require('ampersand-radio-view');
module.exports = FormView.extend({
fields: function () {
return [
new RadioView({
label: 'Gender',
name: 'gender',
value: 'female',
required: false,
text: 'Female',
checked: this.model.gender ? (this.model.gender == 'female') : false,
parent: this
}),
new RadioView({
name: 'gender',
value: 'male',
required: false,
text: 'Male',
checked: this.model.gender ? (this.model.gender == 'male') : false,
parent: this
})
];
}
});
Note: the standard "type" property from ampersand-input-view is hardcoded in the radio control to "hidden", so there's really no benefit to putting type: "radio" in your declaration options. Suggestion: Only use the "label" property for the first radio view in the set, and use that label as the set's label.
Thanks to the Ampersand group!
MIT
FAQs
A view module for radio buttons.
The npm package ampersand-radio-view receives a total of 9 weekly downloads. As such, ampersand-radio-view popularity was classified as not popular.
We found that ampersand-radio-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.