[Fixed] How angular 2 app works without root module?

Issue

As per the angular documentation

Every Angular app has a root module class. By convention, the root
module class is called AppModule and it exists in a file named
app.module.ts.

But if you see this example in plunker http://embed.plnkr.co/Sxu5eMAvsQ4x89fFDWdT/, there is no root module exist. Can someone please explain how this angular app works without root module? or is there something I am missing?

I saw the below code in main.ts which bootstraps the main component

bootstrap(AppComponent, [
  APP_ROUTER_PROVIDERS
])
.catch(err => console.error(err));

I am confused where does the root module goes?

Solution

The example project you refer to was built against a prerelese version of Angular (RC2), before they introduced modules in Angular RC5.

Leave a Reply

(*) Required, Your email will not be published