String operations for angular 8+ projects (ng9)
This preview was generated with Stackblitz
This library was generated with Angular CLI version 9.1.9.
To use this package as a service npm i ngx-page-title
install this on the root angular project .
Note: Don't forget to run this commend
npm i ngx-page-title
on root folder or else it will throw error.
Import the module on your app.module.ts
file as follow.
import { NgxPageTitleModule } from "ngx-page-title";
Then import the module as follow on imports array
NgxPageTitleModule
In your constructor
of a required component import the service as follow
import { NgxPageTitleService } from 'ngx-page-title';
Add the dependency on construtor as follows
constructor(private title: NgxPageTitleService) {
this.title.setTitle("title goes here")
}
After importing this library with npm install ngx-page-title
, go to the component which is declared under app.module.ts
and integrate as below. use it on any component or else declare it on app.component.ts
for enabling it global to application.