MCPcopy
hub / github.com/angular/components / validate

Method validate

src/aria/private/toolbar/toolbar.ts:174–184  ·  view source on GitHub ↗

Returns a set of violations

()

Source from the content-addressed store, hash-verified

172
173 /** Returns a set of violations */
174 validate(): string[] {
175 const violations: string[] = [];
176
177 const values = this.inputs.items().map(w => w.value());
178 const duplicates = values.filter((val, idx) => values.indexOf(val) !== idx);
179 if (duplicates.length > 0) {
180 violations.push(`Duplicate value '${duplicates[0]}' detected inside ngToolbar.`);
181 }
182
183 return violations;
184 }
185
186 /** Handles keydown events for the toolbar. */
187 onKeydown(event: KeyboardEvent) {

Callers

nothing calls this directly

Calls 3

pushMethod · 0.65
valueMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected