Not able to use provider in Ionic 2 (2.0.0-rc.4)


Database provider

import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';

export class Database {

  constructor(public http: Http) {
    console.log('Hello Database Provider');


import { Database } from '../providers/database';

  templateUrl: 'app.html',
export class MyApp {


import { Database } from '../providers/database';

  declarations: [
    MyApp  ],
  imports: [
    IonicModule.forRoot(MyApp)  ],
  bootstrap: [IonicApp],
  entryComponents: [    MyApp   ],
  providers: [Database]

List.ts (page)

import { Database } from '../providers/database';

  selector: 'page-list',
  templateUrl: 'list.html',
  providers: [Database]
export class ListPage {
   constructor(public navCtrl: NavController, public navParams: NavParams, public dataservice: Database) {

The error is can not find name Database

Kindly help me fix this error

I am using following version
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.47
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.2
Xcode version: Not installed


Don’t put providers in the component, only the app module.


Thank you. It worked