ionicBootstrap not importing in app.component.ts i

2019-09-08 15:59发布

问题:

Hi Everyone, My name is Kris Chery. I am new to ionic and am using version 2.1.18. I have been following this tutorial which I think is very insightful about the powers of ionic. https://www.joshmorony.com/an-in-depth-explanation-of-providers-in-ionic-2/

I am stuck at the ionicBootstrap implementation. For now its a simple service that needs to display a message but for some reason. I can't seem to import ionic Bootstrap it is saying that ionicBoostrap wasn't exported from node modules.

This is information is imperative for me to my dream app. Any help would be much appreciated.

UPDATE: I have done a number or research on the matter but none led to a good explanation on how to fix it or to implement it properly.

回答1:

I'd recommend not using that tutorial and using the official Angular docs instead. That was written back in July. Back then Angular 2 was only in RC phase and Ionic 2 was still in beta. A lot has changed since then.

You don't want to use bootstrapping for this, your app already does it's bootstrapping in app.ts. Instead in app.module.ts you can import other module and declare providers.

Angular 2 Tutorial: https://angular.io/docs/ts/latest/tutorial/ Bootstrapping and modules: https://angular.io/docs/ts/latest/guide/ngmodule.html#!#bootstrap