Skip to content

Instantly share code, notes, and snippets.

View kaaboeld's full-sized avatar

Eugene Popov kaaboeld

View GitHub Profile
@kaaboeld
kaaboeld / seo.service.ts
Created June 24, 2016 09:21
Example working service for adding meta tags to <head/> for angular2-universal. Based on http://blog.devcross.net/2016/04/17/angular-2-universal-seo-friendly-website/
import {Injectable,Inject,ElementRef, Renderer} from '@angular/core';
//import { DOCUMENT } from '@angular/platform/common_dom';
import {DOCUMENT} from '@angular/platform-browser';
@Injectable()
export class SeoService {
private _r: Renderer;
private _el: ElementRef;
private _document: any;
/**