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

ng build ERROR #14

Closed
smile2014 opened this issue Sep 28, 2016 · 2 comments
Closed

ng build ERROR #14

smile2014 opened this issue Sep 28, 2016 · 2 comments

Comments

@smile2014
Copy link

ERROR in [default] e:\learning\angular2\Angular2-HNews-master\src\app\stories\stories.component.ts:31:49
Property 'storiesType' does not exist on type '{ [name: string]: any; }'.

ERROR in [default] e:\learning\angular2\Angular2-HNews-master\src\app\user\user.component.ts:25:33
Property 'fetchUser' does not exist on type 'HackerNewsAPIService'.

@housseindjirdeh
Copy link
Owner

Thank you for filing this!

Property 'storiesType' does not exist on type '{ [name: string]: any; }' is just because the compiler can't find a storiesType parameter on the object. A quick fix is just to assign type any to the response object to opt-out of type checking. I updated my code with this fix a short while ago:

ngOnInit() {
  this.typeSub = this.route
   .data
    .subscribe(data => this.storiesType = (data as any).storiesType);

// ...
}

Property 'fetchUser' does not exist on type 'HackerNewsAPIService'. Hmm where are you seeing this issue? The fetchUser method should be in the data service whenever it's being called so just double check and see if you might have forgotten to add it.

@housseindjirdeh
Copy link
Owner

@smile2014 Going to close this, but please let me know if you're still seeing issues

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

2 participants