widgets.pbCheckbox.pbCheckbox.ctrl.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ui-designer-artifact-builder-generator-angularjs Show documentation
Show all versions of ui-designer-artifact-builder-generator-angularjs Show documentation
This module is a generator on AngularJS for Artifact Builder
function PbCheckboxCtrl($scope, $log, widgetNameFactory) {
$scope.$watch('properties.value', function(value) {
if (value === 'true' || value === true) {
$scope.properties.value = true;
} else {
$scope.properties.value = false;
}
});
this.name = widgetNameFactory.getName('pbCheckbox');
this.inputId = widgetNameFactory.getId('pbCheckbox');
if (!$scope.properties.isBound('value')) {
$log.error('the pbCheckbox property named "value" need to be bound to a variable');
}
}