feat(elements): implement NgElementApplicationContext
This commit is contained in:

committed by
Victor Berchet

parent
6b30fbf94e
commit
75cf70ae04
18
packages/elements/src/ng-element-application-context.ts
Normal file
18
packages/elements/src/ng-element-application-context.ts
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ApplicationRef, Injector, NgZone} from '@angular/core';
|
||||
|
||||
export class NgElementApplicationContext {
|
||||
applicationRef = this.injector.get<ApplicationRef>(ApplicationRef);
|
||||
ngZone = this.injector.get<NgZone>(NgZone);
|
||||
|
||||
constructor(public injector: Injector) {}
|
||||
|
||||
runInNgZone<R>(cb: () => R): R { return this.ngZone.run(cb); }
|
||||
}
|
Reference in New Issue
Block a user