evertonrobertoauler / universal-demo-v5

26 stars 14 forks source link

Title is not getting added in server side rendering #2

Closed jinnabaalu closed 6 years ago

jinnabaalu commented 6 years ago

in my component set my Title property as

constructor(public titleService: Title) { }

ngOnInit() {
this.titleService.setTitle('Test | Test title');
}

This shows in client side rendering not in serverside rendering

If i need to set the page title, description, image, keywords to a page dynamically what is the best way to do in serverside rendering.

evertonrobertoauler commented 6 years ago

Hi

Take a look on this commit, it works: https://github.com/evertonrobertoauler/universal-demo-v5/commit/4e92151a05aa52e6090bf7f4d1738027602c9d06

Disable Javascript or inspect the network tab on the developer tools, you will see that the title and meta tags come already rendered from the server. screenshot from 2017-11-22 09-13-33

jinnabaalu commented 6 years ago

In this case if you see there is no description rendered to the header part. And How we can also render images from the physical path of the application. or based on the url?

Can you can we make this and run as a docker container too.?