-
Notifications
You must be signed in to change notification settings - Fork 0
RadioBox
View:
<ma-radio-box
item="'Yes'"
value="answer">
</ma-radio-box>
<ma-radio-box
item="'No'"
value="answer">
</ma-radio-box>
Controller:
$scope.answer = null;
View:
<ma-radio-box
item="ports[0]"
value="port">
</ma-radio-box>
<ma-radio-box
item="ports[1]"
value="port">
</ma-radio-box>
<ma-radio-box
item="ports[2]"
value="port">
</ma-radio-box>
Controller:
$scope.ports = ['Tokai', 'Vladivostok', 'Navlakhi'];
$scope.port = null;
View:
<ma-radio-box
item="ports[0]"
item-text-field="name"
item-value-field="id"
value="port">
</ma-radio-box>
<ma-radio-box
item="ports[1]"
item-text-field="name"
item-value-field="id"
value="port">
</ma-radio-box>
<ma-radio-box
item="ports[2]"
item-text-field="name"
item-value-field="id"
value="port">
</ma-radio-box>
Controller:
$scope.ports = [{
id: 1,
name: 'Tokai'
}, {
id: 2,
name: 'Vladivostok'
}, {
id: 3,
name: 'Navlakhi'
}];
$scope.port = null;
Determines whether the text is displayed.
Boolean
false
Sets the field:
View:
<ma-radio-box
hide-text="true">
</ma-radio-box>
Determines whether the component is disabled.
Boolean
false
Sets the field:
View:
<ma-radio-box
is-disabled="true">
</ma-radio-box>
A string or an object associated with the component, which is set as value when the component is selected.
Object
null
Sets the field:
View:
<ma-radio-box
item="ports[0]"
value="port">
</ma-radio-box>
<ma-radio-box
item="ports[1]"
value="port">
</ma-radio-box>
<ma-radio-box
item="ports[2]"
value="port">
</ma-radio-box>
Controller:
$scope.ports = ['Tokai', 'Vladivostok', 'Navlakhi'];
$scope.port = null;
A function used to create text.
Function
null
Sets the field:
View:
<ma-radio-box
item-template="itemTemplate">
</ma-radio-box>
Controller:
$scope.ports: [{
id: 0,
name: 'Tokai',
country: {
name: 'Japan'
}
}, {
id: 2,
name: 'Vladivostok',
country: {
name: 'Russia'
}
}, {
id: 3,
name: 'Navlakhi',
country: {
name: 'India'
}
}];
$scope.itemTemplate = function(port) {
return port.name + ' (' + port.country.name + ')';
};
The name of item field which will be used as text.
The field is relevant only when the item is object.
String
null
Sets the field:
View:
<ma-radio-box
item="ports[0]"
item-text-field="name">
</ma-radio-box>
Controller:
$scope.ports = [{
id: 1,
name: 'Tokai'
}, {
id: 2,
name: 'Vladivostok'
}, {
id: 3,
name: 'Navlakhi'
}];
The name of item field which will be used as a unique identifier of the item.
The field is relevant only when the item is object.
String
null
Sets the field:
View:
<ma-radio-box
item="ports[0]"
item-value-field="id">
</ma-radio-box>
Controller:
$scope.ports = [{
id: 1,
name: 'Tokai'
}, {
id: 2,
name: 'Vladivostok'
}, {
id: 3,
name: 'Navlakhi'
}];
Size of the component.
Supported sizes: 'xs'
, 'sm'
.
String
'xs'
Sets the field:
View:
<ma-radio-box
size="sm">
</ma-radio-box>
A value of the component which is bound to an outer scope with two-way data binding.
Object
null
Sets the field:
View:
<ma-radio-box
item="ports[0]"
item-text-field="name"
item-value-field="id"
value="port">
</ma-radio-box>
<ma-radio-box
item="ports[1]"
item-text-field="name"
item-value-field="id"
value="port">
</ma-radio-box>
<ma-radio-box
item="ports[2]"
item-text-field="name"
item-value-field="id"
value="port">
</ma-radio-box>
Controller:
$scope.ports = [{
id: 1,
name: 'Tokai'
}, {
id: 2,
name: 'Vladivostok'
}, {
id: 3,
name: 'Navlakhi'
}];
$scope.port = $scope.ports[1];
Fires when the value is changed by the user.
maValue Object
Value or null if the value is empty.
maOldValue Object
Old value or null if the old value is empty.
Subscribes to change
event:
View:
<ma-radio-box
change="change(maValue, maOldValue)">
</ma-radio-box>
Controller:
$scope.change = function(port, oldPort) {
// Handle the event.
};