@ngsm/title
v0.1.2
Published
<p align="center"> <a href="https://github.com/ng-sm"> <img src="https://avatars2.githubusercontent.com/u/64587411?s=150"> </a> </p> <p align="center"> Title module based on the @ngx-translate/core package. </p>
Downloads
58
Maintainers
Readme
Installation
yarn add @ngsm/title
or npm i @ngsm/title --save
Requirements
Library requires @ngx-translate/core
, you can use also @ngsm/i18n
module.
Usage
App module:
import { I18nModule } from '@ngsm/i18n';
import { TitleModule } from '@ngsm/title';
...
@NgModule({
imports: [
...
TitleModule,
I18nModule,
],
...
})
export class AppModule {}
Single routing:
const routes: Routes = [
{
path: '',
component: MyPageComponent,
data: {
title: 'title.myPage',
},
},
];
...
Translations should be added in i18n
directory in your assets (for example /src/assets/i18n/en.json
):
{
"title": {
"myPage": "Here is my title",
"default": "My default title",
"suffix": "My title suffix"
}
}