-
Notifications
You must be signed in to change notification settings - Fork 518
Server-side Metadata for SEO #554
Comments
Unfortunately, at the moment you'll need to just create your own interface to handle this like you can see below (angular/universal#309 (comment)) Eventually I believe the regular This method below currently isn't working, we're looking into adding some Lifecycle hooks to potential add in the upcoming 2.4 release of Universal (a bug fix release before the eventual move to Angular Core)
|
Thanks @MarkPieszak! |
Thanks for the reply, Mark. This seems to be similar to the Title service in angular 2 (client-side). Perhaps there's a problem with my implementation? Here's an example of what I'm doing app.component.ts after importing the service to app.module.ts and adding it to the providers array:
}` |
Hmm this might be an issue with the .NET integration (since we're not getting the whole document, but rather just |
Thanks @MarkPieszak |
@levarcooper So this is currently broken, and I'm hoping we can get in a Universal 2.4 version in sometime before the attempted merge into Angular Core. Maybe we'll be able to get a lifecycle hook or something in there temporarily in that release. |
@SteveSandersonMS Should we keep this one open for now? We're looking into adding some Lifecycle hooks to be potentially added in the upcoming 2.4 release of Universal (a bug fix release before the eventual move to Angular Core) |
@MarkPieszak, do you have more info about the workarounds you eluded to above. I was considering trying to pass javascript variables into the viewdata. Are there any known approaches that allow angular to communicate with dotnet at runtime? |
Are you talking about passing it from .NET over to the front-end? @levarcooper |
The Angular2 Demo Application does not update the title page. It displays "Home" for each view. I used the SetTitle property as explained in the Angular2 documentation but I believe the function references the document. Running it with an isBrowser conditional inside of ngOnInit works for aesthetics but search engines wouldn't detect the changes. What's the best way to update the metadata server-side?
The text was updated successfully, but these errors were encountered: