refactor(NgUpgrade): remove deprecated addProvider

BREAKING CHANGE: previously deprecated UpgradeAdapter#addProvider was removed, see deprecation notice for migration instructions.
This commit is contained in:
Igor Minar
2016-08-12 12:30:08 -07:00
committed by Vikram Subramanian
parent d2825077b1
commit 12b0a3d0e5
3 changed files with 7 additions and 49 deletions

View File

@ -450,49 +450,6 @@ export class UpgradeAdapter {
return upgrade;
}
/**
* Adds a provider to the top level environment of a hybrid AngularJS v1 / Angular v2 application.
*
* In hybrid AngularJS v1 / Angular v2 application, there is no one root Angular v2 component,
* for this reason we provide an application global way of registering providers which is
* consistent with single global injection in AngularJS v1.
*
* ### Example
*
* ```
* class Greeter {
* greet(name) {
* alert('Hello ' + name + '!');
* }
* }
*
* @Component({
* selector: 'app',
* template: ''
* })
* class App {
* constructor(greeter: Greeter) {
* this.greeter('World');
* }
* }
*
* var adapter = new UpgradeAdapter();
* adapter.addProvider(Greeter);
*
* var module = angular.module('myExample', []);
* module.directive('app', adapter.downgradeNg2Component(App));
*
* document.body.innerHTML = '<app></app>'
* adapter.bootstrap(document.body, ['myExample']);
*```
*
* @deprecated Use NgModules and `new UpgradeAdapter(ng2AppModule)` to configure top-level
*providers
*/
public addProvider(provider: Type<any>|Provider|any[]|any): void {
this.providers.push(provider);
}
/**
* Allows AngularJS v1 service to be accessible from Angular v2.
*