-
Notifications
You must be signed in to change notification settings - Fork 0
CheckBox
View:
<ma-check-box
text="Balcony"
value="hasBalcony">
</ma-check-box>
Controller:
$scope.hasBalcony = false;
An object that provides API for the component.
View:
<ma-check-box
instance="checkBox">
</ma-check-box>
Controller:
$scope.checkBox = {};
// API object can be used after the component has been initialized by AngularJS,
// which is often after a timeout or in callback functions.
$timeout(function() {
var isValid = checkBox.isValid();
});
Determines whether the component is disabled.
Boolean
false
Sets the field:
View:
<ma-check-box
is-disabled="true">
</ma-check-box>
Determines whether a value is required.
If value is not selected by the user the component will become invalid and will be highlighted accordingly.
Boolean
false
Sets the field:
View:
<ma-check-box
is-required="true">
</ma-check-box>
Determines whether the component is rendered from right to left.
Boolean
false
Sets the field:
View:
<ma-check-box
rtl="true">
</ma-check-box>
Size of the component.
Supported sizes: 'xs'
, 'sm'
.
String
'xs'
Sets the field:
View:
<ma-check-box
size="sm">
</ma-check-box>
Text to be displayed.
String
''
Sets the field:
View:
<ma-check-box
text="Balcony">
</ma-check-box>
A list of validators which is used to validate the value each time it is changed.
Array
null
Sets the field:
View:
<ma-check-box
validators="[checkBoxValidator]">
</ma-check-box>
Controller:
$scope.checkBoxValidator = {
validate: function(value) {
// Check the value somehow and return true or false.
return true;
}
};
A value of the component which is bound to an outer scope with two-way data binding.
Boolean
false
Sets the field:
View:
<ma-check-box
text="Balcony"
value="hasBalcony">
</ma-check-box>
Controller:
$scope.hasBalcony = false;
Fires when the value is changed by the user.
maValue Boolean
Value of the component.
Subscribes to the event:
View:
<ma-check-box
value="hasBalcony"
change="change(maValue)">
</ma-check-box>
Controller:
$scope.hasBalcony = false;
$scope.change = function(hasBalcony) {
// Handle the event.
};
Determines whether the component is initialized.
View:
<ma-check-box
instance="checkBox">
</ma-check-box>
Controller:
$scope.checkBox = {};
$timeout(function() {
var isInitialized = checkBox.isInitialized;
}, 5000);
Determines whether the value of the component is valid.
View:
<ma-check-box
instance="checkBox">
</ma-check-box>
Controller:
$scope.checkBox = {};
$timeout(function() {
var isValid = checkBox.isValid();
}, 5000);
Validates the value and highlights the component accordingly.
View:
<ma-check-box
instance="checkBox">
</ma-check-box>
Controller:
$scope.checkBox = {};
$timeout(function() {
checkBox.validate();
}, 5000);