feat(elements): implement NgElementApplicationContext

This commit is contained in:
George Kalpakas
2017-10-12 18:02:34 +03:00
committed by Victor Berchet
parent 6b30fbf94e
commit 75cf70ae04
2 changed files with 70 additions and 0 deletions

View 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); }
}