vinaygopinath / ng2-meta

Dynamic meta tags and SEO in Angular2
MIT License
201 stars 44 forks source link

Support Rendering Server Side? #6

Open maxiar opened 7 years ago

maxiar commented 7 years ago

Is this component support Rendering Server Side by Angular Universal?

scott-wyatt commented 7 years ago

It doesn't, though that would be supper cool! The issue with it using universal is that the backend doesn't have the ability to modify the head yet. The Universal guys are working on that though, in the mean time you can use the Renderer from @angular/core to make changes to the DOM before serving the file.

amauryprieto commented 7 years ago

@scott-wyatt would you mind sharing and example of how to use the Renderer to modify meta tags?

scott-wyatt commented 7 years ago

Like all things angular, that part of angular has changed again lol. The universal guys are working on a Meta Service to allow for this server side.

mklemme commented 7 years ago

It looks like something is underway for this: https://github.com/angular/angular/pull/12322

PickRelated commented 7 years ago

Looks like we will have angular metatags built-in, but no sooner than 2.3.0 beta release. Nevertheless, I wonder if this wonderful module is going to get server side rendering support. @vinaygopinath, any thoughts on this?

vinaygopinath commented 7 years ago

I'd like to make ng2-meta compatible with server-side rendering. I've been following the activity on the angular/universal thread, and it looks like using DomAdapter instead of plain old document while creating/updating meta elements would be the key change.

Does anyone want to take a crack at it?

kodeine commented 7 years ago

@vinaygopinath yes i guess lets use DomAdapter.

kodeine commented 7 years ago

@vinaygopinath any updates on this?

dukang commented 7 years ago

hey guys, any update?

nicky-lenaers commented 7 years ago

Any updates? I'd really like to see this working!

yaroslavOshyyko commented 7 years ago

Angular Universal Starter has angular2-meta service that helps modify head tag in server side. This service will be added to @angular/platform-browser in Angular 4.0.