Hi Reza,

Make sure your code is indeed running in the browser itself before touching 
the DOM!
You ca get an hold to the document via the injector like this:

import { Inject, Injectable } from '@angular/core';import { DOCUMENT } from 
'@angular/platform-browser';
@Injectable()export class MyService {
  constructor(@Inject(DOCUMENT) private document: any) {}}



Hope this helps you a bit,
Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to