title: How to emit event from child to parent using ngx-translate
body: <p>I use ngx-translate to make a multilingual web in angular. I use JSON files for languages and place them in assets / i18n / en.json (for english language) and assets / i18n / ge.json for german language. I implemented EventEmit event from child to parent as follows:</p>
  
  <p><strong>child.component.ts :</strong></p>
  
  <pre><code>private translateService: TranslateService;
  @Output() showLanguage = new EventEmitter();
  
  constructor(translateService: TranslateService) {
      this.translateService = translateService;
      this.translateService.setDefaultLang('en');
    }
  
  
  
   switchLanguage(language: string) {
      this.showLanguage.emit(this.translateService.use(language));
    }
  </code></pre>
  
  <p><strong>Child.html</strong></p>
  
  <pre><code>  &lt;button (click)="switchLanguage('en')"&gt;en&lt;/button&gt;
    &lt;button (click)="switchLanguage('fr')"&gt;fr&lt;/button&gt;
  </code></pre>
  
  <p><strong>parent.component.ts</strong></p>
  
  <pre><code>private translateService: TranslateService;
   constructor(translateService: TranslateService) {
      this.translateService = translateService;
    }
  switchLanguage(language) {
      this.translateService.use(this.language);
   }
  </code></pre>
  
  <p><strong>Parent.html</strong></p>
  
  <pre><code>  &lt;child-page (showLanguage)="switchLanguage($event)"&gt;&lt;child-page&gt;
  </code></pre>
  
  <p><strong>App.module.ts</strong></p>
  
  <pre><code> export function HttpLoaderFactory(http: HttpClient) {
    return new TranslateHttpLoader(http);
    }
  
    @NgModule({
    declarations: [
      AppComponent
    ],
    imports: [
      BrowserModule,
      HttpClientModule,
      TranslateModule.forRoot({
        loader: {
          provide: TranslateLoader,
          useFactory: HttpLoaderFactory,
          deps: [HttpClient]
        }
      })
    ],
    providers: [],
    bootstrap: [AppComponent]
  })
  </code></pre>
  
  <p>But when i click button angular throw me error :</p>
  
  <pre><code>ERROR TypeError: Object(...) is not a function
      at TranslateService.use (ngx-translate-core.js:555)
      at ChildComponent.switchLanguage (childcomponent.component.ts:40)
      at Object.eval [as handleEvent] (ChildComponent.html:12)
      at handleEvent (core.js:13589)
      at callWithDebugContext (core.js:15098)
      at Object.debugHandleEvent [as handleEvent] (core.js:14685)
      at dispatchEvent (core.js:10004)
      at eval (core.js:10629)
      at HTMLButtonElement.eval (platform-browser.js:2628)
      at ZoneDelegate.invokeTask (zone.js:398)
      at Object.onInvokeTask (core.js:4751)
      at ZoneDelegate.invokeTask (zone.js:397)
      at Zone.runTask (zone.js:165)
      at HTMLButtonElement.ZoneTask.invoke (zone.js:460)
  </code></pre>
  
  <p>Please help me. Thank</p>