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

Function setSelectedIndex

packages/core/src/render3/state.ts:766–777  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

764 * run if and when the provided `index` value is different from the current selected index value.)
765 */
766export function setSelectedIndex(index: number) {
767 ngDevMode &&
768 index !== -1 &&
769 assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Index must be past HEADER_OFFSET (or -1).');
770 ngDevMode &&
771 assertLessThan(
772 index,
773 instructionState.lFrame.lView.length,
774 "Can't set index passed end of LView",
775 );
776 instructionState.lFrame.selectedIndex = index;
777}
778
779/**
780 * Gets the `tNode` that represents currently selected element.

Callers 6

enterViewWithOneDivFunction · 0.90
applyUpdateOpCodesFunction · 0.90
executeTemplateFunction · 0.90
selectIndexInternalFunction · 0.90

Calls 2

assertGreaterThanOrEqualFunction · 0.90
assertLessThanFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…