refactor(core): change bootstrap of modules and names of platforms

BREAKING CHANGES:
- `browserPlatform`/`browserDynamicPlatform`/... have been deprecated and renamed into `platformBrowser`/`platformBrowserDynamic`/....
- `bootstrapModule` and `bootstrapModuleFactory` have been moved to be members of `PlaformRef`.
  E.g. `platformBrowserDynamic().bootstrapModule(MyModule)`.
This commit is contained in:
Tobias Bosch
2016-07-26 05:21:19 -07:00
parent 00b726f695
commit 5a21f168d6
27 changed files with 219 additions and 163 deletions

View File

@ -14,7 +14,7 @@ import {AnimateCmp} from './animate';
import {BasicComp} from './basic';
import {CompWithAnalyzeEntryComponentsProvider, CompWithEntryComponents} from './entry_components';
import {CompWithProviders, CompWithReferences, ModuleUsingCustomElements} from './features';
import {CompUsingRootModuleDirectiveAndPipe, SomeDirectiveInRootModule, someLibModuleWithProviders, SomePipeInRootModule, SomeService} from './module_fixtures';
import {CompUsingRootModuleDirectiveAndPipe, SomeDirectiveInRootModule, SomePipeInRootModule, SomeService, someLibModuleWithProviders} from './module_fixtures';
import {ProjectingComp} from './projection';
import {CompWithChildQuery, CompWithDirectiveChild} from './queries';

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {NgModuleFactory, NgModuleRef, bootstrapModuleFactory} from '@angular/core';
import {NgModuleFactory, NgModuleRef} from '@angular/core';
import {ComponentFixture} from '@angular/core/testing';
import {serverPlatform} from '@angular/platform-server';
@ -14,7 +14,7 @@ import {MainModule} from '../src/module';
import {MainModuleNgFactory} from '../src/module.ngfactory';
export function createModule(): NgModuleRef<MainModule> {
return bootstrapModuleFactory(MainModuleNgFactory, serverPlatform());
return serverPlatform().bootstrapModuleFactory(MainModuleNgFactory);
}
export function createComponent<C>(comp: {new (...args: any[]): C}): ComponentFixture<C> {