Ionic beta8 global component

Hi, is there a way to declare a component directive as global, in a way that you dont need to do a

directives: [component1]

in each page component.
the case before(beta6) was that when you include a component and declare it as directive in app.ts you dont need to re-declare it in each page.

You could use bootstrap.

What xr0rmaster says, include the directive inside the bootstrapping process instead of declaring it on the app as a directive. I.e. like this:

ionicBootstrap(ConferenceApp, [ConferenceData, UserData], {
  tabbarPlacement: 'bottom'

For an example of an Ionic2 beta .8 app check out the conference app.

Hmm, i think i got confused. it was stated thats for providers. ill test it.

thanks for the response :slight_smile:

Hey yall, so the correct answer would be to use the directives property on the root component.

  directives: [Comp1, Comp2]

Plus importing them into the root component.

1 Like


Using the directives property in the root component no longer works after upgrading to beta 8.