### File

`src/app/app.component.ts`

### Metadata

providers | `TextService`
selector | `app-root`
styleUrls | `app.component.scss`
templateUrl | `./app.component.html`

### Constructor

`constructor(translate: TranslateService)`
Defined in src/app/app.component.ts:12
Parameters :
Name | Type | Optional | Description
translate | `TranslateService` |  |

    import { Component } from '@angular/core';
    import { TranslateService } from '@ngx-translate/core';
    import { TextService } from './shared';

    @Component({
        selector: 'app-root',
        templateUrl: './app.component.html',
        styleUrls: ['./app.component.scss'],
        providers: [ TextService ]
    })
    export class AppComponent {
        constructor(private translate: TranslateService) {
            translate.addLangs(['en', 'fr', 'ur', 'es', 'fa']);
            translate.setDefaultLang('en');
            const browserLang = translate.getBrowserLang();
            translate.use(browserLang.match(/en|fr|ur|es|fa/) ? browserLang : 'en');
        }
    }

    <router-outlet></router-outlet>

Legend
Html element
Component
Html element with directive

# results matching ""

# No results matching ""