MCPcopy Index your code
hub / github.com/angular/angular / getStringParameter

Function getStringParameter

modules/benchmarks/src/util.ts:15–34  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

13}
14
15export function getStringParameter(name: string) {
16 const els = document.querySelectorAll(`input[name="${name}"]`);
17 let value: any;
18 let el: any;
19
20 for (let i = 0; i < els.length; i++) {
21 el = els[i];
22 const type = el.type;
23 if ((type != 'radio' && type != 'checkbox') || el.checked) {
24 value = el.value;
25 break;
26 }
27 }
28
29 if (value == null) {
30 throw new Error(`Could not find and input field with name ${name}`);
31 }
32
33 return value;
34}
35
36export function bindAction(selector: string, callback: () => void) {
37 document.querySelector(selector)!.addEventListener('click', callback);

Callers 1

getIntParameterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…