This part is confusing, and I only figured out through trial and error. Being a newbie to Typescript, Ionic 2, and Angular 2, I’ve been doing a lot of reading. What I’ve found in the Angular 2 docs is that you should be creating modules for features of your code. The Angular docs recommend that you bootstrap a root module that contains everything for your project.
Naturally, I tried this with Ionic2, but quickly ran into errors with providers, among other things. Turns out that I need to set all my providers on a root component for it to work in Ionic2.
At first when I was doing this import { NgModule } from '@angular/core'
I would get an error that NgModule was not present. I ignored it, thinking that it was Visual Studio intellisense error. Only after many hours of debugging, reading, and trial and error I have come to the conclusion that Ionic 2 includes a version of Angular 2 that doesn’t have NgModules (unless their hidden somewhere else).
Not sure why this isn’t mentioned in the Ionic 2 documentation. Seems important enough to me. Probably save someone else a lot of pain too.
Anyone have any explanation for this?