MCPcopy Create free account
hub / github.com/angular/components / validate

Method validate

src/aria/private/toolbar/toolbar.ts:175–185  ·  view source on GitHub ↗

Returns a set of violations

()

Source from the content-addressed store, hash-verified

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