Hi I am developing web application in Angular 5. I have tree view with checkbox. Whenever data is loaded onto page, based on the property I am making checkbox checked or not checked. I am accepting little different behavior here. Whenever property is false i want to add cross mark in checkbox by default. Below is my code which will render tree view with checkbox.
<tree-root #tree [options]="options" [nodes]="nodes">
<ng-template #treeNodeTemplate let-node="node" let-index="index">
<input (change)="check(node, !node.data.checked)"
type="checkbox"
[indeterminate]="node.data.indeterminate"
[checked]="node.data.checked" class="css-checkbox">
</ng-template>
</tree-root>
In the above code snippet whenever node.data.checked is true then I am making checkbox checked b default. Whenever node.data.checked comes false I want to display cross mark in checkbox. I have searched over the net but did not get any use full links. Can some one help me to make this work? Any help would be greatly appreciated. Thank you.
Aucun commentaire:
Enregistrer un commentaire