1

I would like to use angular2-dart in non-spa as in

loading two components in angular2 non SPA

i.e. in any non-spa page (not just index.html), I would like to have something like

<body>
  <my-app-a>
    loading...
  </my-app-a>

  Static content 

  <my-app-b>
      loading ..
  </my-app-b>
 </body>

How can this be done using angular2-dart? This will allow to bootstrap arbitrary Angular2-dart component(s) in any non-spa page.

Community
  • 1
  • 1
marcg
  • 552
  • 1
  • 8
  • 20

1 Answers1

1

Just call bootstrap() twice in web/main.dart, like this:

void main() {
  bootstrap(AppComponent);
  bootstrap(App2Component);
}

I just tried it and it works fine.

filiph
  • 2,673
  • 2
  • 26
  • 33