title: Can't resolve all parameters for AngularFirestores: ([object Object], ? )
body: <h2>What I'm Using</h2>
  
  <ul>
  <li>Angular 5</li>
  <li>AngularFire5</li>
  <li>Firebase &amp; Firestore</li>
  </ul>
  
  <h2>What I'm Trying to Achieve</h2>
  
  <p>I am trying to build my app for production, however I keep running into the following errors:</p>
  
  <pre><code>ERROR in Error: Can't resolve all parameters for AngularFirestore in /Users/gurgengrigory
  an/Desktop/LiquidLink/node_modules/angularfire2/firestore/index.d.ts: ([object Object], ?
  ).
  </code></pre>
  
  <h2>What I have So Far</h2>
  
  <h3>app.module.ts</h3>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
  
  import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
  import { AngularFireModule } from 'angularfire2';
  import { AngularFireAuthModule } from 'angularfire2/auth';
  import { AngularFirestoreModule, AngularFirestore } from 'angularfire2/firestore';
  import { AngularFontAwesomeModule } from 'angular-font-awesome';
  
  import { AppComponent } from './app.component';
  import { AppRoutingModule } from './app-routing.module';
  import { AuthService } from './auth.service';
  import { LinkService } from './link.service';
  import { environment } from '../environments/environment.prod';
  import { NavbarComponent } from './navbar/navbar.component';
  import { HomeComponent } from './home/home.component';
  import { LoginComponent } from './login/login.component';
  import { RegisterComponent } from './register/register.component';
  import { DashboardComponent } from './dashboard/dashboard.component';
  import { LinkTableComponent } from './dashboard/link-table/link-table.component';
  import { AddLinkComponent } from './home/add-link/add-link.component';
  import { RedirectComponent } from './redirect/redirect.component';
  import { ErrorComponent } from './error/error.component'
  
  
  @NgModule({
    declarations: [
      AppComponent,
      NavbarComponent,
      HomeComponent,
      LoginComponent,
      RegisterComponent,
      DashboardComponent,
      LinkTableComponent,
      AddLinkComponent,
      RedirectComponent,
      ErrorComponent
    ],
    imports: [
      BrowserModule,
      FormsModule,
      NgbModule.forRoot(),
      AppRoutingModule,
      AngularFireModule.initializeApp(environment.firebase),
      AngularFireAuthModule,
      AngularFirestoreModule,
      AngularFontAwesomeModule
    ],
    providers: [AngularFirestore, AuthService, LinkService],
    bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>
  
  <h3>link.service.ts</h3>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { AuthService } from './auth.service';
  import { AngularFirestore, AngularFirestoreDocument, AngularFirestoreCollection } from 'angularfire2/firestore';
  
  export interface Link { uid: string; url: string; shortURL: string; clicks: number }
  
  @Injectable()
  export class LinkService {
    shortURL = '';
  
    constructor(public authService: AuthService, private afs: AngularFirestore) {
    }
    createShortURL() {
      var text = '';
      var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
      var length = 6;
  
      for(var i = 0; i &lt; length; i++) {
          text += possible.charAt(Math.floor(Math.random() * possible.length));
      }
      return this.shortURL = text;
    }
    addLink(url: string) {
      this.afs.collection('Links').doc(this.shortURL).set({
        'uid': this.authService.currentUserId,
        'url': url,
        'shortURL': this.shortURL,
        'clicks': 0
      });
    }
  }
  </code></pre>
  
  <h3>redirect.component.ts</h3>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { Router } from '@angular/router';
  import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument } from 'angularfire2/firestore';
  import { Observable } from 'rxjs/Observable';
  import 'rxjs/add/operator/map';
  
  @Component({
    selector: 'app-redirect',
    templateUrl: './redirect.component.html',
    styleUrls: ['./redirect.component.css']
  })
  export class RedirectComponent implements OnInit {
  
    linkRef: AngularFirestoreDocument&lt;any&gt;;
    link: Observable&lt;any&gt;;
    path: string;
    url: string;
    constructor(private afs: AngularFirestore, private router: Router) {
      this.path = this.router.url.replace('/','');
      this.linkRef = this.afs.collection('Links').doc(this.path);
      this.link = this.linkRef.valueChanges();
      this.link.subscribe(data =&gt; {
        if (data === null) {
          this.router.navigate(['/404']);
        } else {
          this.url = data.url;
          window.location.href = data.url;
        }
      });
    }
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <h3>add-link.component.ts</h3>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { AuthService } from '../../auth.service';
  import { LinkService } from '../../link.service';
  
  @Component({
    selector: 'app-add-link',
    templateUrl: './add-link.component.html',
    styleUrls: ['./add-link.component.css']
  })
  export class AddLinkComponent implements OnInit {
  
    url = '';
    alert: boolean = false;
  
    constructor(public authService: AuthService, public LinkService: LinkService) { }
  
    ngOnInit() {
    }
    onAddLink() {
      if (this.authService.isUserEmailLoggedIn) {
        this.LinkService.createShortURL();
        this.LinkService.addLink(this.url);
        this.clearFields();
        this.alert = false;
      } else {
        this.clearFields();
        this.alert = true;
      }
    }
    dismiss() {
      this.alert = false;
    }
    clearFields() {
      this.url = '';
    }
  }
  </code></pre>
  
  <h3>link-table.component.ts</h3>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { Router } from '@angular/router';
  import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument } from 'angularfire2/firestore';
  
  @Component({
    selector: 'app-link-table',
    templateUrl: './link-table.component.html',
    styleUrls: ['./link-table.component.css']
  })
  export class LinkTableComponent implements OnInit {
    links: any;
    constructor(private afs: AngularFirestore) {
      this.links = afs.collection('Links').valueChanges();
    }
  
    ngOnInit() {
    }
  }
  </code></pre>
  
  <p>I think this is an issue with circular dependency, in my constructors, though im not sure how to resolve it.</p>