2016-10-20 22:35:35 -04:00
|
|
|
/** @experimental */
|
2016-11-09 09:37:20 -05:00
|
|
|
export declare function downgradeComponent(info: {
|
|
|
|
component: Type<any>;
|
2017-07-11 09:15:51 -04:00
|
|
|
/** @experimental */ propagateDigest?: boolean;
|
2017-03-14 17:55:37 -04:00
|
|
|
/** @deprecated */ inputs?: string[];
|
|
|
|
/** @deprecated */ outputs?: string[];
|
|
|
|
/** @deprecated */ selectors?: string[];
|
2016-11-09 09:37:20 -05:00
|
|
|
}): any;
|
2016-10-20 22:35:35 -04:00
|
|
|
|
|
|
|
/** @experimental */
|
feat(upgrade): return a function (instead of array) from `downgradeInjectable()` (#14037)
This makes it more consistent with the dynamic version of `upgrade` and makes it
possible to share code between the dynamic and static versions.
This commit also refactors the file layout, moving common and dynamic-specific
files to `common/` and `dynamic/` directories respectively and renaming `aot/`
to `static/`.
Some private keys, used as AngularJS DI tokens, have also been renamed, but this
should not affect apps, since these keys are undocumented and not supposed to
be used externally.
BREAKING CHANGE:
Previously, `upgrade/static/downgradeInjectable` returned an array of the form:
```js
['dep1', 'dep2', ..., function factory(dep1, dep2, ...) { ... }]
```
Now it returns a function with an `$inject` property:
```js
factory.$inject = ['dep1', 'dep2', ...];
function factory(dep1, dep2, ...) { ... }
```
It shouldn't affect the behavior of apps, since both forms are equally suitable
to be used for registering AngularJS injectable services, but it is possible
that type-checking might fail or that current code breaks if it relies on the
returned value being an array.
2017-01-13 09:20:28 -05:00
|
|
|
export declare function downgradeInjectable(token: any): Function;
|
2016-10-20 22:35:35 -04:00
|
|
|
|
2017-07-11 09:15:51 -04:00
|
|
|
/** @experimental */
|
perf: switch angular to use StaticInjector instead of ReflectiveInjector
This change allows ReflectiveInjector to be tree shaken resulting
in not needed Reflect polyfil and smaller bundles.
Code savings for HelloWorld using Closure:
Reflective: bundle.js: 105,864(34,190 gzip)
Static: bundle.js: 154,889(33,555 gzip)
645( 2%)
BREAKING CHANGE:
`platformXXXX()` no longer accepts providers which depend on reflection.
Specifically the method signature when from `Provider[]` to
`StaticProvider[]`.
Example:
Before:
```
[
MyClass,
{provide: ClassA, useClass: SubClassA}
]
```
After:
```
[
{provide: MyClass, deps: [Dep1,...]},
{provide: ClassA, useClass: SubClassA, deps: [Dep1,...]}
]
```
NOTE: This only applies to platform creation and providers for the JIT
compiler. It does not apply to `@Compotent` or `@NgModule` provides
declarations.
Benchpress note: Previously Benchpress also supported reflective
provides, which now require static providers.
DEPRECATION:
- `ReflectiveInjector` is now deprecated as it will be remove. Use
`Injector.create` as a replacement.
closes #18496
2017-08-03 15:33:29 -04:00
|
|
|
export declare function downgradeModule<T>(moduleFactoryOrBootstrapFn: NgModuleFactory<T> | ((extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>)): string;
|
2017-07-11 09:15:51 -04:00
|
|
|
|
2017-05-09 13:55:38 -04:00
|
|
|
export declare function getAngularJSGlobal(): any;
|
|
|
|
|
|
|
|
/** @deprecated */
|
2017-04-14 14:25:56 -04:00
|
|
|
export declare function getAngularLib(): any;
|
|
|
|
|
2017-05-09 13:55:38 -04:00
|
|
|
export declare function setAngularJSGlobal(ng: any): void;
|
|
|
|
|
|
|
|
/** @deprecated */
|
2017-04-14 14:25:56 -04:00
|
|
|
export declare function setAngularLib(ng: any): void;
|
|
|
|
|
2016-10-20 22:35:35 -04:00
|
|
|
/** @experimental */
|
2016-10-20 06:42:57 -04:00
|
|
|
export declare class UpgradeComponent implements OnInit, OnChanges, DoCheck, OnDestroy {
|
2016-10-20 22:35:35 -04:00
|
|
|
constructor(name: string, elementRef: ElementRef, injector: Injector);
|
|
|
|
ngDoCheck(): void;
|
|
|
|
ngOnChanges(changes: SimpleChanges): void;
|
2016-10-20 06:42:57 -04:00
|
|
|
ngOnDestroy(): void;
|
2016-10-20 22:35:35 -04:00
|
|
|
ngOnInit(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @experimental */
|
|
|
|
export declare class UpgradeModule {
|
2016-11-09 09:37:20 -05:00
|
|
|
$injector: any;
|
2016-10-20 22:35:35 -04:00
|
|
|
injector: Injector;
|
|
|
|
ngZone: NgZone;
|
2016-11-09 09:37:20 -05:00
|
|
|
constructor(
|
|
|
|
injector: Injector,
|
|
|
|
ngZone: NgZone);
|
|
|
|
bootstrap(element: Element, modules?: string[], config?: any): void;
|
2016-10-20 22:35:35 -04:00
|
|
|
}
|
2017-01-31 22:18:28 -05:00
|
|
|
|
|
|
|
export declare const VERSION: Version;
|