refactor(abstract): Use abstract keyword where possible to decrease file size. (#14112)
PR Close: #14112
This commit is contained in:

committed by
Miško Hevery

parent
827c3fe199
commit
d339d8b81d
@ -6,7 +6,6 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {unimplemented} from '../facade/errors';
|
||||
import {stringify} from '../facade/lang';
|
||||
import {Type} from '../type';
|
||||
|
||||
@ -55,10 +54,9 @@ export abstract class Injector {
|
||||
* Injector.THROW_IF_NOT_FOUND is given
|
||||
* - Returns the `notFoundValue` otherwise
|
||||
*/
|
||||
get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T): T;
|
||||
abstract get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T): T;
|
||||
/**
|
||||
* @deprecated from v4.0.0 use Type<T> or InjectToken<T>
|
||||
*/
|
||||
get(token: any, notFoundValue?: any): any;
|
||||
get(token: any, notFoundValue?: any): any { return unimplemented(); }
|
||||
abstract get(token: any, notFoundValue?: any): any;
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {unimplemented} from '../facade/errors';
|
||||
import {Type} from '../type';
|
||||
|
||||
import {Injector, THROW_IF_NOT_FOUND} from './injector';
|
||||
@ -467,7 +466,7 @@ export abstract class ReflectiveInjector implements Injector {
|
||||
* expect(child.parent).toBe(parent);
|
||||
* ```
|
||||
*/
|
||||
get parent(): Injector { return unimplemented(); }
|
||||
abstract get parent(): Injector;
|
||||
|
||||
/**
|
||||
* Resolves an array of providers and creates a child injector from those providers.
|
||||
@ -496,7 +495,7 @@ export abstract class ReflectiveInjector implements Injector {
|
||||
* because it needs to resolve the passed-in providers first.
|
||||
* See {@link Injector#resolve} and {@link Injector#createChildFromResolved}.
|
||||
*/
|
||||
resolveAndCreateChild(providers: Provider[]): ReflectiveInjector { return unimplemented(); }
|
||||
abstract resolveAndCreateChild(providers: Provider[]): ReflectiveInjector;
|
||||
|
||||
/**
|
||||
* Creates a child injector from previously resolved providers.
|
||||
@ -549,7 +548,7 @@ export abstract class ReflectiveInjector implements Injector {
|
||||
* expect(car).not.toBe(injector.resolveAndInstantiate(Car));
|
||||
* ```
|
||||
*/
|
||||
resolveAndInstantiate(provider: Provider): any { return unimplemented(); }
|
||||
abstract resolveAndInstantiate(provider: Provider): any;
|
||||
|
||||
/**
|
||||
* Instantiates an object using a resolved provider in the context of the injector.
|
||||
@ -575,7 +574,7 @@ export abstract class ReflectiveInjector implements Injector {
|
||||
* expect(car).not.toBe(injector.instantiateResolved(carProvider));
|
||||
* ```
|
||||
*/
|
||||
instantiateResolved(provider: ResolvedReflectiveProvider): any { return unimplemented(); }
|
||||
abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;
|
||||
|
||||
abstract get(token: any, notFoundValue?: any): any;
|
||||
}
|
||||
|
Reference in New Issue
Block a user