Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Error in http-loader.d.ts #35

Open
Davilink opened this issue Dec 15, 2017 · 5 comments
Open

Error in http-loader.d.ts #35

Davilink opened this issue Dec 15, 2017 · 5 comments

Comments

@Davilink
Copy link

Davilink commented Dec 15, 2017

I'm submitting a ... (check one with "x")

[x] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request

Current behavior
The definition tell us that it return an type <any>

Expected/desired behavior
The definition should return Observable<any>

Reproduction of the problem

  1. Creating a class who inherit of the TranslateHttpLoader
  2. using super.getTranslation

What is the motivation / use case for changing the behavior?
Does have to cast to get the right intellisense.

  • ngx-translate/http-loader version: 1.1.0

  • Angular version: 4.4.4

  • Browser: N/A

image

but should be

image

@devdaddy
Copy link

devdaddy commented Mar 9, 2018

I am having a similar issue that I believe stems from the same thing.

Can't resolve all parameters for TranslateHttpLoader in 
            /node_modules/@ngx-translate/http-loader/src/http-loader.d.ts: ([object Object], ?, ?).

Have you found a solution for this?

@Davilink
Copy link
Author

Davilink commented Mar 9, 2018

@devdaddy You problem doesn't come from that, if more likely that you forgot to provider the HttpClient in the module that import ngx-translate.

@devdaddy
Copy link

devdaddy commented Mar 9, 2018

Nope,

...

import { HttpClient, HttpClientModule } from "@angular/common/http";
import { TranslateModule, TranslateLoader } from "@ngx-translate/core";
import { TranslateHttpLoader } from "@ngx-translate/http-loader";

...

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http);
}
@NgModule({

  ...

  imports: [
    BrowserModule,
    HttpClientModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    }),
  
...

Thoughts?

@Davilink
Copy link
Author

@devdaddy Sadly i have no idea.

@ceaguilera
Copy link

@devdaddy you solved? I have the miss problem

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

No branches or pull requests

3 participants