@kovalenko/translatable-title
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

TranslatableTitle

Translates the title and watches language change

Installation

npm install @kovalenko/translatable-title

First, import the TranslatableTitleModule to your module:

import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {MainMenuModule} from '@kovalenko/translatable-title';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppComponent} from './app';

@NgModule({
  imports: [
    BrowserModule,
    TranslatableTitleModule
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent],
})
export class AppModule {
}

platformBrowserDynamic().bootstrapModule(AppModule);

Then inject TranslatableTitleService into your component:

import {Component} from '@angular/core';
import {TranslatableTitleService} from '@kovalenko/translatable-title';

@Component({
  selector: 'app',
  template: ``,
})
export class AppComponent {
  readonly items = this.mainMenuService.items;
  constructor(private translatableTitleService: TranslatableTitleService) {
    translatableTitleService.setTitle('Title');
  }
}

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @kovalenko/translatable-title

Weekly Downloads

0

Version

1.0.0

License

none

Unpacked Size

23 kB

Total Files

14

Last publish

Collaborators

  • kovalenko