How to set page title dynamically in Angular | Angular | Learn Smart Coding

Publicado em: 21 Abril 2022
no canal de: Learn Smart Coding
3,242
46

Hi Friends, This video is all about how to set page titles dynamically on each page in Angular. It is a simple approach to setting the page title.

In your component, just import Title
import { Title } from '@angular/platform-browser';

Inject Title in the constructor like this "private titleService: Title"

inside ngOnInit() or in any other method whichever is appropriate, use the "setTitle" method to set the title.

this.titleService.setTitle('your title content goes here');

Please post your questions in the comment section and I will be happy to answer your questions.

Subscribe for more useful videos just like this:    / @learnsmartcoding  

Happy coding!


Nesta página do site você pode assistir ao vídeo on-line How to set page title dynamically in Angular | Angular | Learn Smart Coding duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Learn Smart Coding 21 Abril 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 3,242 vezes e gostou 46 espectadores. Boa visualização!