10 examples of 'angular 4 checkbox binding' in JavaScript

Every line of 'angular 4 checkbox binding' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
17link(scope, element, attrs) {
18}
25function attatchCheckbox() {
26 element.prop('lastElementChild').firstElementChild.appendChild($compile(createCheckBox())(scope)[0]);
27}
152ngAfterViewInit(): void {
153 if (this.checkbox) {
154 const ff = this.domUtils.closest(this.elementRef.nativeElement,
155 '.mat-form-field-wrapper');
156 if (ff) {
157 ff.classList.add('no-underline');
158 }
159 }
160}
30updateNgModel(value) {
31 this.ngModelController && this.ngModelController.$setViewValue(value); // change model value & $setViewValue method will trigger method binding on model
32}
22get isChecked() {
23 return this.value === this.innerValue;
24}
30constructor(protected layoutService: DynamicFormLayoutService,
31 protected validationService: DynamicFormValidationService,
32 @Inject(MAT_RIPPLE_GLOBAL_OPTIONS) @Optional() public RIPPLE_OPTIONS: RippleGlobalOptions) {
33
34 super(layoutService, validationService);
35}
30get isChecked() {
31 return true === this.innerValue;
32}
24get buttonChecked() {
25 return this._checked;
26}
27get nzCheckbox(): boolean {
28 return this._checkbox;
29}
12function initCheckbox(vm, checkbox, index) {
13 let init = checkbox.initCheckboxGroupName;
14 if (typeof init === 'function') {
15 const checkState = vm._checkState;
16
17 let value = init.call(checkbox, vm.groupName);
18 checkState.push({checked: checkbox.checked, value});
19
20 checkbox.$on('change', e => {
21 checkState[index].checked = e.target.checked;
22
23 let checkedValues = [];
24 checkState.forEach(
25 item => item.checked && checkedValues.push(item.value)
26 );
27 vm.$emit('change', {detail: {value: checkedValues}});
28 });
29 }
30}

Related snippets