Exception: Call to Node module failed with error: Error: Uncaught (in promise): Error: DI Error Error: DI Error

image

I received the above error.  Turns out I didn’t add the service to the providers.  Not a very helpful error message though so I figured I would blog it.

Before Fix

@Component({     selector: 'home',     templateUrl: './home.component.html'
})

After Fix

@Component({     selector: 'home',     templateUrl: './home.component.html',

providers: [ MyService ] })

At some point during this I had gotten ‘no provider for’ which lead me to here: http://stackoverflow.com/questions/30580083/angular2-no-provider-for-nameservice