refactor: remove various leftover unused or deprecated code (#11091)

This commit is contained in:
Igor Minar
2016-08-26 09:12:27 -07:00
committed by Victor Berchet
parent 0cf5ece7f8
commit 4d7d2a2daa
8 changed files with 1 additions and 84 deletions

View File

@ -284,41 +284,6 @@ export function main() {
ref.dispose();
});
}));
// this test should be removed ones the deprecated @Components.directives prop is removed
// we should rewrite all of the tests in this file to use modules instead.
it('should downgrade ng2 component that is part of a module', async(() => {
const ng1Module = angular.module('ng1', []);
ng1Module.component('ng1Component', {template: '<ng2-component></ng2-component>'});
const SpecialValue = new OpaqueToken('special test value');
const Ng2Component = Component({
selector: 'ng2-component',
template: '<span>test: {{value}}</span>'
}).Class({
constructor: [
Inject(SpecialValue), function Ng2Component(value: number) { this.value = value; }
]
});
const Ng2AppModule =
NgModule({
declarations: [Ng2Component],
imports: [BrowserModule],
providers: [{provide: SpecialValue, useValue: 23}]
}).Class({constructor: function Ng2AppModule() {}, ngDoBootstrap: function() {}});
const adapter = new UpgradeAdapter(Ng2AppModule);
ng1Module.directive('ng2Component', adapter.downgradeNg2Component(Ng2Component));
var element = html('<ng1-component></ng1-component>');
adapter.bootstrap(element, ['ng1']).ready((ref) => {
expect(multiTrim(document.body.getElementsByTagName('ng2-component')[0].innerHTML))
.toEqual('<span>test: 23</span>');
ref.dispose();
});
}));
});
describe('upgrade ng1 component', () => {