refactor(Provider): remove deprecated provider/bind API (#10652)
Closes #9751 BREAKING CHANGE: These forms of providers are no longer accepted: bind(MyClass).toFactory(...) new Provider(MyClass, toFactory: ...) We now only accept: {provider: MyClass, toFactory: ...}
This commit is contained in:
@ -1,30 +0,0 @@
|
||||
/**
|
||||
* @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 {bind, provide} from '@angular/core';
|
||||
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
|
||||
export function main() {
|
||||
describe('provider', () => {
|
||||
|
||||
describe('type errors', () => {
|
||||
|
||||
it('should throw when trying to create a class provider and not passing a class', () => {
|
||||
expect(() => {
|
||||
bind('foo').toClass(<any>0);
|
||||
}).toThrowError('Trying to create a class provider but "0" is not a class!');
|
||||
});
|
||||
|
||||
it('should throw when trying to create a factory provider and not passing a function', () => {
|
||||
expect(() => {
|
||||
bind('foo').toFactory(<any>0);
|
||||
}).toThrowError('Trying to create a factory provider but "0" is not a function!');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user