MCPcopy Index your code
hub / github.com/angular/components / _checkTreeControlUsage

Method _checkTreeControlUsage

src/cdk/tree/tree.ts:488–510  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

486 }
487
488 private _checkTreeControlUsage() {
489 if (typeof ngDevMode === 'undefined' || ngDevMode) {
490 // Verify that Tree follows API contract of using one of TreeControl, levelAccessor or
491 // childrenAccessor. Throw an appropriate error if contract is not met.
492 let numTreeControls = 0;
493
494 if (this.treeControl) {
495 numTreeControls++;
496 }
497 if (this.levelAccessor) {
498 numTreeControls++;
499 }
500 if (this.childrenAccessor) {
501 numTreeControls++;
502 }
503
504 if (!numTreeControls) {
505 throw getTreeControlMissingError();
506 } else if (numTreeControls > 1) {
507 throw getMultipleTreeControlsError();
508 }
509 }
510 }
511
512 /** Check for changes made in the data and render each change (node added/removed/moved). */
513 renderNodeChanges(

Callers 1

ngOnInitMethod · 0.95

Calls 2

Tested by

no test coverage detected