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

Function getSelectorFor

packages/compiler/test/selector/selector_spec.ts:586–606  ·  view source on GitHub ↗
({
  tag = '',
  attrs = [],
  classes = '',
}: {tag?: string; attrs?: any[]; classes?: string} = {})

Source from the content-addressed store, hash-verified

584});
585
586function getSelectorFor({
587 tag = '',
588 attrs = [],
589 classes = '',
590}: {tag?: string; attrs?: any[]; classes?: string} = {}): CssSelector {
591 const selector = new CssSelector();
592 selector.setElement(tag);
593
594 attrs.forEach((nameValue) => {
595 selector.addAttribute(nameValue[0], nameValue[1]);
596 });
597
598 classes
599 .trim()
600 .split(/\s+/g)
601 .forEach((cName) => {
602 selector.addClassName(cName);
603 });
604
605 return selector;
606}

Callers 1

selector_spec.tsFile · 0.85

Calls 4

setElementMethod · 0.95
addAttributeMethod · 0.95
addClassNameMethod · 0.95
forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…