Ionic 2 release migration -> provider error


#1

I’ve upgraded from the last Ionic 2 beta release to the RC0. When I try to create a page component which includes a provider in it, the page is blank and this error is shown: Uncaught Error: Can’t resolve all parameters for BackgroundPicturePage: (LoadingController, AlertController, NavController, ?, TranslateService).

Here are my files:

app.module.ts:

import { User } from '../models/User';

......

providers: [
    User,
],

background-picture.component.ts:

import {Component} from '@angular/core';
import {User} from '../../models/User';

@Component({
  templateUrl: 'background-picture.html',
})
export class BackgroundPicturePage {
  constructor(
    public loadingCtrl: LoadingController,
    public alertCtrl: AlertController,
        public nav: NavController,
        public user: User,
        public translate: TranslateService
    ) {
    }
}

User.ts:

import {Injectable} from '@angular/core';

@Injectable()
export class User {
 ... logic ...
}

My ionic info output

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v6.3.0
Xcode version: Xcode 8.0 Build version 8A218a


#2

Exact Same problem here:

Uncaught Error: Can’t resolve all parameters for HomePage: (NavController, ?, ViewController, ToastController,…