Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'length' of undefined #181

Open
sithwin opened this issue Jun 7, 2017 · 1 comment
Open

TypeError: Cannot read property 'length' of undefined #181

sithwin opened this issue Jun 7, 2017 · 1 comment

Comments

@sithwin
Copy link

sithwin commented Jun 7, 2017

I'm getting following error when I run ng test in my angular 2 project .spec file.

Here is my .html => I used *ngIf="mylistobject.length < 1

<div *ngIf="mylistobject.length < 1">
        <p>No existing object</p>
</div>

Error:
TypeError: Cannot read property 'length' of undefined at Object.eval [as updateDirectives] (ng:///DynamicTestModule/MemberFormComponent.ngfactory.js:518:36) at Object.debugUpdateDirectives [as updateDirectives] (http://localhost:9876/base/src/test.ts?91a6b67a27b0b8b8d3495726f24574322d324ff6:13112:21) at checkAndUpdateView (http://localhost:9876/base/src/test.ts?91a6b67a27b0b8b8d3495726f24574322d324ff6:12450:14) at callViewAction (http://localhost:9876/base/src/test.ts?91a6b67a27b0b8b8d3495726f24574322d324ff6:12813:21) at execEmbeddedViewsAction (http://localhost:9876/base/src/test.ts?91a6b67a27b0b8b8d3495726f24574322d324ff6:12771:17) at checkAndUpdateView (http://localhost:9876/base/src/test.ts?91a6b67a27b0b8b8d3495726f24574322d324ff6:12451:5) at callViewAction (http://localhost:9876/base/src/test.ts?91a6b67a27b0b8b8d3495726f24574322d324ff6:12813:21) at execComponentViewsAction (http://localhost:9876/base/src/test.ts?91a6b67a27b0b8b8d3495726f24574322d324ff6:12745:13) at checkAndUpdateView (http://localhost:9876/base/src/test.ts?91a6b67a27b0b8b8d3495726f24574322d324ff6:12456:5) at callWithDebugContext (http://localhost:9876/base/src/test.ts?91a6b67a27b0b8b8d3495726f24574322d324ff6:13512:42)

@maksimr
Copy link
Contributor

maksimr commented Aug 22, 2017

@sithwin why do you think that problem in karma-jasmine?

In stack trace I see that problem in (ng:///DynamicTestModule/MemberFormComponent.ngfactory.js:518:36) at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants