i am used to import bootstrap by plattform-browser-dynamic 2.0.0 like this:
import { bootstrap } from '@angular/platform-browser-dynamic/';
Now i create new Projekt and use angular release 2.2.0 Plattform-browser-dynamic packages has version 2.2.0:
"@angular/common": "~2.2.0",
"@angular/compiler": "~2.2.0",
"@angular/core": "~2.2.0",
"@angular/forms": "~2.2.0",
"@angular/http": "~2.2.0",
"@angular/platform-browser": "~2.2.0",
"@angular/platform-browser-dynamic": "~2.2.0",
"@angular/router": "~3.2.0",
"@angular/upgrade": "~2.2.0",
"angular-in-memory-web-api": "~0.1.15"
I try same like with package 2.0.0 to import bootstrap, but it will not be found. My code:
import { bootstrap } from '@angular/platform-browser-dynamic/*';
import {AppComponent} from "./app.component";
bootstrap(AppComponent);
ERROR:
error TS2305: Module '"../node_modules/@angular/platform-browser-dynamic/index"' has no exported member 'bootstrap'.
How can i fix that? i cant find some similar lib.
As per angular final release you can bootstrap your application module using platformbrowser's bootstrapModule method. Additonally you need to create your own module for your App.
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
main.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
Plunkr Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With