Closed prashantpimpale93 closed 6 years ago
@prashantpimpale93 minimum ng version for mat-tree is 6+
Ok, then is it mandatory (As I don't know how much it will impact) to upgrade Version 4 to 6?
@djleonskennedy Yes I tried update but getting error :
Argument of type '(node: TodoItemNode) => TodoItemNode[]' is not assignable to parameter of type '(node: TodoItemNode) => Observable<TodoItemNode[]>'.
Type 'TodoItemNode[]' is not assignable to type 'Observable<TodoItemNode[]>'.
Property '_isScalar' is missing in type 'TodoItemNode[]'.
Each major version of Angular Material requires at least the same major version of Angular. E.g., Angular Material v6 requires Angular v6.
I also have the same issue. the minimum requirements are met.
my packages:
"dependencies": {
"@angular/cdk": "^6.3.3",
"@angular/material": "^6.3.3",
"angular2-pubsub": "^4.0.3",
"hammerjs": "^2.0.8"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.6.3",
"@angular/animations": "^6.0.5",
"@angular/cli": "6.0.5",
"@angular/common": "6.0.5",
"@angular/compiler": "6.0.5",
"@angular/compiler-cli": "6.0.5",
"@angular/core": "6.0.5",
"@angular/forms": "6.0.5",
"@angular/http": "6.0.5",
"@angular/language-service": "6.0.5",
"@angular/platform-browser": "6.0.5",
"@angular/platform-browser-dynamic": "6.0.5",
"@angular/router": "6.0.5",
"@ngx-translate/core": "10.0.1",
"@ngx-translate/http-loader": "3.0.1",
"@types/jasmine": "2.8.7",
"@types/jasminewd2": "2.0.3",
"@types/node": "8.9.4",
"codelyzer": "4.2.1",
"core-js": "2.5.6",
"electron": "2.0.3",
"electron-builder": "20.14.7",
"electron-reload": "1.2.2",
"jasmine-core": "3.1.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "^2.0.4",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "2.0.0",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "1.1.0",
"npm-run-all": "4.1.3",
"npx": "10.2.0",
"protractor": "5.3.2",
"rxjs": "6.1.0",
"ts-node": "6.0.3",
"tslint": "5.10.0",
"typescript": "2.7.2",
"wait-on": "2.1.0",
"webdriver-manager": "12.0.6",
"zone.js": "0.8.26"
}
I have all packages in 6.* version.
I found a workaround for this:
if you still getting the same error in the console then do this:
private getChildren(node: FileNode): Observable<FileNode[]> {
const observable = of(node.children);
return observable;
}
@MRebati Thanks! will try and inform the same
i am also facing same issue
Argument of type '(node: TodoItemNode) => TodoItemNode[]' is not assignable to parameter of type '(node: TodoItemNode) => Observable<TodoItemNode[]>'. Type 'TodoItemNode[]' is not assignable to type 'Observable<TodoItemNode[]>'. Property '_isScalar' is missing in type 'TodoItemNode[]'.
hear i am using angular6 amgular material 6 and "rxjs" 6 as well
please have look my packege.json
{ "name": "my-app", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^6.0.7", "@angular/cdk": "^6.3.3", "@angular/common": "^6.0.7", "@angular/compiler": "^6.0.7", "@angular/core": "^6.0.7", "@angular/forms": "^6.0.7", "@angular/http": "^6.0.7", "@angular/material": "^6.3.3", "@angular/platform-browser": "^6.0.7", "@angular/platform-browser-dynamic": "^6.0.7", "@angular/router": "^6.0.7", "@ng-bootstrap/ng-bootstrap": "^2.2.1", "@ngrx/core": "^1.2.0", "@ngrx/effects": "^6.1.0", "@ngrx/entity": "^6.1.0", "@ngrx/router-store": "^6.1.0", "@ngrx/store": "^6.1.0", "@ngrx/store-devtools": "^6.1.0", "@swimlane/ngx-datatable": "^13.1.0", "amexio-ng-extensions": "^5.0.5", "angular-font-awesome": "^3.1.2", "angular2-fontawesome": "^5.2.1", "bootstrap": "^4.1.3", "chart.js": "^2.7.2", "core-js": "^2.5.4", "echarts": "^4.1.0", "font-awesome": "^4.7.0", "jquery": "^3.3.1", "ng2-charts": "^1.6.0", "ng2-table": "^1.3.2", "ng2-tooltip": "0.0.7", "ng2-tree": "^2.0.0-alpha.8", "ngx-echarts": "^4.0.0", "ngx-treeview": "^6.0.0", "rxjs": "^6.3.1", "rxjs-compat": "^6.3.1", "tether": "^1.4.4", "zone.js": "^0.8.26" }, "devDependencies": { "@angular-devkit/build-angular": "~0.6.0", "@angular-devkit/build-ng-packagr": "~0.6.0", "@angular/cli": "6.0.8", "@angular/compiler-cli": "^6.0.7", "@angular/language-service": "^6.0.7", "@ngrx/schematics": "^6.1.0", "@types/jasmine": "~2.8.6", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "codelyzer": "~4.2.1", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~1.7.1", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~1.4.2", "karma-jasmine": "~1.1.1", "karma-jasmine-html-reporter": "^0.2.2", "ng-packagr": "^3.0.0-rc.2", "protractor": "~5.3.0", "ts-node": "~5.0.1", "tsickle": ">=0.25.5", "tslib": "^1.7.1", "tslint": "~5.9.1", "typescript": "~2.7.2" } }
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Bug, feature request, or proposal:
I am trying to integrate angular material Tree module in my project. When I copied the related code from Document in my project it's throwing an error.
What is the expected behavior?
It should work after npm install
What is the current behavior?
Error:
1)
Argument of type '(node: TodoItemNode) => TodoItemNode[]' is not assignable to parameter of type '(node: TodoItemNode) => Observable<TodoItemNode[]>'. Type 'TodoItemNode[]' is not assignable to type 'Observable<TodoItemNode[]>'. Property '_isScalar' is missing in type 'TodoItemNode[]'.
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
"typescript": "~2.3.3"
"rxjs": "^5.5.11"
Is there anything else we should know?
Package.Json:
Imports in Component: