0

Steps to create a new angular 2 project:

ng new myapp cd myapp npm i ng2-smart-table --save

And change the app.module.ts:

import { Ng2SmartTableModule } from 'ng2-smart-table';

// ...

@NgModule({
  imports: [
    // ...

    Ng2SmartTableModule,

    // ...
  ],
  declarations: [ ... ]
})
// ...

Then I got the following error message when I try to run ng serve:

ERROR in /Users/Public/myapp/node_modules/ng2-smart-table/src/ng2-smart-table/lib/data-source/server/server.data-source.ts (70,12): Type 'Observable' is not assignable to type 'Observable'. Property 'source' is protected but type 'Observable' is not a class derived from 'Observable'.)

Then the whole project stops running even the part which caused the problem is actually not used at all.

By the way, my specs:

angular-cli: 1.0.0-beta.30
node: 7.5.0
os: darwin x64
@angular/common: 2.4.6
@angular/compiler: 2.4.6
@angular/core: 2.4.6
@angular/forms: 2.4.6
@angular/http: 2.4.6
@angular/platform-browser: 2.4.6
@angular/platform-browser-dynamic: 2.4.6
@angular/router: 3.4.6
@angular/cli: 1.0.0-beta.30
@angular/compiler-cli: 2.4.6

Any idea? Thanks.

EDIT:

Fixed the issue.

Fixed the issue.

ng2-smart-table's package.json contains this:

  "dependencies": {
    "ng2-completer": "^1.0.0",
    "rxjs": "~5.0.2"
  },

but rxjs should be here instead:

  "peerDependencies": {
    "rxjs": "^5.0.2"
  },

Delete the rxjs folder inside node_modules of ng2-smart-table. Rerun npm i.

Gilles Gouaillardet
  • 8,193
  • 11
  • 24
  • 30
Bagusflyer
  • 12,675
  • 21
  • 96
  • 179

1 Answers1

0

i don't see any error here. it's just clean app generated by angular-cli: 1.0.0-beta.26 angular

Tiep Phan
  • 12,386
  • 3
  • 38
  • 41