Skip to content

Commit 846bf32

Browse files
gkalpakpetebacondarwin
authored andcommitted
minor fixes here and there
1 parent 72b3ba5 commit 846bf32

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

Diff for: modules/@angular/upgrade/src/aot/upgrade_module.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ export class UpgradeModule {
3232
ngDoBootstrap() {}
3333

3434
/**
35-
* Bootstrap this NgModule with into an Angular 1 application.
35+
* Bootstrap this NgModule into an Angular 1 application.
3636
* @param element the element on which to bootstrap the Angular 1 application
3737
* @param [modules] the Angular 1 modules to bootstrap for this application
3838
* @param [config] optional extra Angular 1 config block to run when bootstrapping
3939
*/
4040
bootstrapNg1(element: Element,
4141
modules: string[] = [],
42-
config: angular.IInjectable = () => {})
42+
config?: angular.IAngularBootstrapConfig)
4343
{
4444
// Create an ng1 module to bootstrap
4545
const upgradeModule = angular.module(NG1_UPGRADE_MODULE_NAME, modules)
@@ -78,8 +78,7 @@ export class UpgradeModule {
7878
// }
7979
// ]);
8080
}
81-
}])
82-
.config(config);
81+
}]);
8382

8483
// Bootstrap the angular 1 application
8584
angular.bootstrap(element, [upgradeModule.name], config);

Diff for: modules/@angular/upgrade/test/upgrade_aot_spec.ts

+14-11
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {Injector, Class, Component, OnChanges, OnDestroy, SimpleChanges, EventEmitter,
10-
NO_ERRORS_SCHEMA, NgModule, NgModuleRef, OpaqueToken, Testability, destroyPlatform,
11-
forwardRef} from '@angular/core';
12-
import {async, fakeAsync, tick} from '@angular/core/testing';
13-
import {BrowserModule, platformBrowser, } from '@angular/platform-browser';
14-
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
15-
import {UpgradeModule, ng2ProviderFactory, ng1ServiceProvider, downgradeNg2Component} from '@angular/upgrade';
16-
import {parseFields} from '@angular/upgrade/src/metadata';
9+
import {
10+
Injector, Class, Component, OnChanges, OnDestroy, SimpleChanges, EventEmitter, NO_ERRORS_SCHEMA,
11+
NgModule, NgModuleRef, OpaqueToken, Testability, destroyPlatform, forwardRef
12+
} from '@angular/core';
13+
import { async, fakeAsync, tick } from '@angular/core/testing';
14+
import { BrowserModule, platformBrowser } from '@angular/platform-browser';
15+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
16+
import {
17+
UpgradeModule, ng2ProviderFactory, ng1ServiceProvider, downgradeNg2Component
18+
} from '@angular/upgrade';
19+
import { parseFields } from '@angular/upgrade/src/metadata';
1720
import * as angular from '@angular/upgrade/src/angular_js';
1821

1922
export function main() {
@@ -44,7 +47,7 @@ export function main() {
4447

4548
// the ng1 app module that will consume the downgraded component
4649
const ng1Module = angular.module('ng1', [])
47-
// create an ng1 facade of the ng1 component
50+
// create an ng1 facade of the ng2 component
4851
.directive('ng2', downgradeNg2Component({ selector: 'ng2', type: Ng2Component }));
4952

5053
const element =
@@ -139,6 +142,7 @@ export function main() {
139142
$rootScope['eventA'] = '?';
140143
$rootScope['eventB'] = '?';
141144
});
145+
142146
@Component({
143147
selector: 'ng2',
144148
inputs: [
@@ -299,7 +303,6 @@ export function main() {
299303
});
300304
}));
301305

302-
303306
it('should fallback to the root ng2.injector when compiled outside the dom', async(() => {
304307

305308
@Component({selector: 'ng2', template: 'test'})
@@ -994,7 +997,7 @@ export function main() {
994997
// create the ng1 module that will import an ng2 service
995998
const ng1Module = angular.module('ng1Module', [])
996999
.factory('ng2Service', ng2ProviderFactory(Ng2Service))
997-
.factory('ng1Service', () => 'ng1 service value');
1000+
.value('ng1Service', 'ng1 service value');
9981001

9991002
it('should export ng2 instance to ng1', async(() => {
10001003
platformBrowserDynamic().bootstrapModule(MyNg2Module).then((ref) => {

0 commit comments

Comments
 (0)