refactor(upgrade): clean up some types

This commit is contained in:
Georgios Kalpakas
2017-07-11 16:15:40 +03:00
committed by Alex Rickabaugh
parent a0b06befb6
commit 44b50427d9
5 changed files with 44 additions and 44 deletions

View File

@ -21,8 +21,8 @@ export function main() {
afterEach(() => destroyPlatform());
it('should interleave scope and component expressions', async(() => {
const log: any[] /** TODO #9100 */ = [];
const l = (value: any /** TODO #9100 */) => {
const log: string[] = [];
const l = (value: string) => {
log.push(value);
return value + ';';
};
@ -46,8 +46,7 @@ export function main() {
template: `{{l('2A')}}<ng1a></ng1a>{{l('2B')}}<ng1b></ng1b>{{l('2C')}}`
})
class Ng2Component {
l: (value: any) => string;
constructor() { this.l = l; }
l = l;
}
@NgModule({
@ -63,7 +62,7 @@ export function main() {
.directive('ng1a', () => ({template: '{{ l(\'ng1a\') }}'}))
.directive('ng1b', () => ({template: '{{ l(\'ng1b\') }}'}))
.directive('ng2', downgradeComponent({component: Ng2Component}))
.run(($rootScope: any /** TODO #9100 */) => {
.run(($rootScope: angular.IRootScopeService) => {
$rootScope.l = l;
$rootScope.reset = () => log.length = 0;
});
@ -72,7 +71,6 @@ export function main() {
html('<div>{{reset(); l(\'1A\');}}<ng2>{{l(\'1B\')}}</ng2>{{l(\'1C\')}}</div>');
bootstrap(platformBrowserDynamic(), Ng2Module, element, ng1Module).then((upgrade) => {
expect(document.body.textContent).toEqual('1A;2A;ng1a;2B;ng1b;2C;1C;');
// https://github.com/angular/angular.js/issues/12983
expect(log).toEqual(['1A', '1C', '2A', '2B', '2C', 'ng1a', 'ng1b']);
});
}));
@ -88,7 +86,7 @@ export function main() {
@Component({
selector: 'my-child',
template: '<div>{{valueFromPromise}}',
template: '<div>{{ valueFromPromise }}</div>',
})
class ChildComponent {
valueFromPromise: number;