GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Tutorials
  • Playground
  • Reference
  • code
  • context
  • Injector

This view

  • Original page
  • New address

GeezerVison is showing angular.dev — runInInjectionContext • Angular

API

function runInInjectionContext<ReturnT>(
  injector: Injector,
  fn: () => ReturnT,
): ReturnT;
@paraminjectorInjector

the injector which will satisfy calls to inject while fn is executing

@paramfn() => ReturnT

the closure to be run in the context of injector

@returnsReturnT

the return value of the function, if any

Description

Runs the given function in the context of the given Injector.

Within the function's stack frame, inject can be used to inject dependencies from the given Injector. Note that inject is only usable synchronously, and cannot be used in any asynchronous callbacks or after any await points.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.