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

Angular 5.x | ERROR TypeError: Cannot read property 'speed' of undefined #3

Closed
kapiladiyecha opened this issue Mar 5, 2018 · 18 comments

Comments

@kapiladiyecha
Copy link

kapiladiyecha commented Mar 5, 2018

This error occurred Without AoT [During ng serve]

Compiled without errors, but IDE shows error:
image

When jumped to the page, where the content placeholder placed, it throws the following error:
image

Versions using:

"ngx-content-loading": "0.0.9-rc1"
"@angular/core": "^5.2.6"
"@angular/cli": "^1.7.1"

@Gbuomprisco
Copy link
Owner

Are you sure you're importing the module?

@kapiladiyecha
Copy link
Author

kapiladiyecha commented Mar 5, 2018

Yes, I'm sure. I've imported module, the first error can be fixed by importing CUSTOM_ELEMENTS_SCHEMA & adding the namespace for svg

Ref: https://stackoverflow.com/questions/39428132/custom-elements-schema-added-to-ngmodule-schemas-still-showing-error

Ref: angular/angular#7216

But, for the second error, the reason is that not able to get content in the package, that's why it's throwing Can not read property 'speed' of undefined.

@Gbuomprisco
Copy link
Owner

Can you post an online demo for this

@kapiladiyecha
Copy link
Author

Thanks for the quick response.

Here is the demo with the same error:
Plunker: https://embed.plnkr.co/TqWCp8HWQ2cm8urnaoPB/
[you can open the console and check error]
image

Zip file with a fresh simple angular-cli project: ngx-content-loading-demo.zip

@sippaprut
Copy link

I got same error on angular 4

@Gbuomprisco
Copy link
Owner

Can you try v 0.0.8? It will still not work with AOT, see the other issue open in this repository for details

@kapiladiyecha
Copy link
Author

Yes @Gbuomprisco, it's working with v 0.0.8.
Thanks for such a nice plugin.
Waiting for AoT support. I'll try to fix bug with the current version and will update here.

@Gbuomprisco
Copy link
Owner

I'm awaiting for news on that as well :)

@kapiladiyecha
Copy link
Author

kapiladiyecha commented Apr 30, 2018

Hi @Gbuomprisco ,

I reopened this because of Cannot read property 'speed' of undefined issue.
As #2 (AoT support) fixed. Can it be fixed in the latest version?

Thanks

@Gbuomprisco
Copy link
Owner

Can you please post the component controller code? From the error content is undefined

@kapiladiyecha
Copy link
Author

kapiladiyecha commented May 3, 2018

As per my understanding, we do not suppose to add anything to controller file right?
We just need to import it to the module and add directives to template (HTML) file.

I've already uploaded the code in earlier comments.

You can check this: Plunker: https://embed.plnkr.co/TqWCp8HWQ2cm8urnaoPB/

Zip file with a fresh simple angular-cli project:

ngx-content-loading-demo.zip

@Gbuomprisco
Copy link
Owner

I wanted to check the property "content". It seems undefined. "Cannot read property 'speed' of undefined". Which in the tempate is referenced by content.

@kapiladiyecha
Copy link
Author

If you see this image, Line number 17,
here speed property used in the ngx-content-loading, which is causing this problem.

image

@Gbuomprisco
Copy link
Owner

Can you show me what content is?

@hatem20
Copy link

hatem20 commented May 11, 2018

@kapiladiyecha you solved the problem?

@kapiladiyecha
Copy link
Author

kapiladiyecha commented May 11, 2018

No @hatem20 , it is not solved yet.

@Gbuomprisco , content is coming from this plugin, I just followed the given steps to import this, and just tried predefined placeholders without any other custom code.

And it is throwing the same error.

I'm not able to understand what else I can share, if you create the fresh project with angular-cli, angular 5.x you may face the same issue.

I already have attached one sample project in previous comment.

Thanks

@hatem20
Copy link

hatem20 commented May 11, 2018

thanks alot @kapiladiyecha
@Gbuomprisco i think this issue should not be closed

@kapiladiyecha
Copy link
Author

@Gbuomprisco Can you please reopen this issue?

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

No branches or pull requests

4 participants