Skip to content

MatTree can not be created in es6 #11580

Closed
@zonkhonk

Description

@zonkhonk

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Should work in es6

What is the current behavior?

Throw following error

ERROR TypeError: Cannot read property 'find' of undefined
at MatTree.ngOnInit (tree.js:484)
at checkAndUpdateDirectiveInline (core.js:11866)
at checkAndUpdateNodeInline (core.js:13394)
at checkAndUpdateNode (core.js:13337)
at debugCheckAndUpdateNode (core.js:14246)
at debugCheckDirectivesFn (core.js:14191)
at Object.eval [as updateDirectives] (TreeCheckListComponent.html:1)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:14180)
at checkAndUpdateView (core.js:13303)
at callViewAction (core.js:13654)

What are the steps to reproduce?

use an example from angular/material
(https://material.angular.io/components/tree/examples)
and change the compiler target to "es6" in tsconfig.json

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

"dependencies": {
"@angular/animations": "^6.0.3",
"@angular/cdk": "^6.2.0",
"@angular/common": "^6.0.3",
"@angular/compiler": "^6.0.3",
"@angular/core": "^6.0.3",
"@angular/forms": "^6.0.3",
"@angular/http": "^6.0.3",
"@angular/material": "^6.2.0",
"@angular/platform-browser": "^6.0.3",
"@angular/platform-browser-dynamic": "^6.0.3",
"@angular/router": "^6.0.3",
"core-js": "^2.5.4",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/compiler-cli": "^6.0.3",
"@angular-devkit/build-angular": "~0.6.5",
"typescript": "~2.7.2",
"@angular/cli": "~6.0.5",
"@angular/language-service": "^6.0.3",
"@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",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1"
}

Is there anything else we should know?

the "_differs" constructor parameter of CdkTree is "undefined" at runtime

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions