title: Cannot resolve parameters for ApplicationModule: (?)
body: <p>Pretty new to Angular.
  My app contains 1 service and 3 components. Compiled successfully.
  I'm getting this error and have no idea what went wrong:</p>
  
  <blockquote>
    <p>Uncaught Error: Can't resolve all parameters for ApplicationModule: (?).</p>
  </blockquote>
  
  <p>Debugging gave me very little idea.. It seems that the issue is related to NSLocaleLocalizations having null dependencies (if that makes sense) - see screenshot below:
  <a href="https://i.stack.imgur.com/PF24Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PF24Y.png" alt="enter image description here"></a></p>
  
  <p>Here is some code:
  Please let me know if anything else is needed.
  Your help is much appreciated - thank you very much.</p>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>{
    "name": "angular_app",
    "version": "0.0.0",
    "scripts": {
      "ng": "ng",
      "start": "ng serve",
      "build": "ng build",
      "build-aot": "ng build --prod --aot",
      "test": "ng test",
      "lint": "ng lint",
      "e2e": "ng e2e"
    },
    "private": true,
    "dependencies": {
    "@angular/animations": "^6.0.0",
    "@angular/cdk": "^6.0.0",
    "@angular/common": "^6.0.0",
    "@angular/compiler": "^6.0.0",
    "@angular/core": "^6.0.0",
    "@angular/forms": "^6.0.0",
    "@angular/http": "^6.0.0",
    "@angular/material": "^6.0.0",
    "@angular/platform-browser": "^6.0.0",
    "@angular/platform-browser-dynamic": "^6.0.0",
    "@angular/router": "^6.0.0",
    "core-js": "^2.5.4",
    "express": "^4.16.4",
    "rxjs": "^6.0.0",
    "zone.js": "^0.8.26"
    },
    "devDependencies": {
    "@angular/compiler-cli": "^6.0.0",
    "@angular-devkit/build-angular": "~0.6.0",
    "typescript": "~2.7.2",
    "@angular/cli": "~6.0.0",
    "@angular/language-service": "^6.0.0",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~1.4.2",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1"
    }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>app.module.ts</strong></p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  import { HttpModule } from '@angular/http';
  
  import { AppRoutingModule } from './app-routing.module';
  import { AppComponent } from './app.component';
  
  import { StoriesComponent } from './pages/stories/stories.component';
  import { StoryComponent } from './pages/story/story.component';
  import { StageComponent } from './pages/stage/stage.component';
  
  @NgModule({
  declarations: [
    AppComponent,
    StoryComponent,
    StoriesComponent,
    StageComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    HttpModule
  ],
  providers: [],
  bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>
  
  <p><strong>app-routing.module.ts</strong></p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { Routes, RouterModule } from '@angular/router';
  
  import { StoriesComponent } from './pages/stories/stories.component';
  import { StoryComponent } from './pages/story/story.component';
  import { StageComponent } from './pages/stage/stage.component';
  
  const routes: Routes = [
    {path: '', redirectTo: '/stories', pathMatch: 'full'},
    {path: 'stories', component:StoriesComponent},
    {path: 'stories/:id', component: StoryComponent},
    {path: 'stories/:id/:id', component: StageComponent}
  ];
  
  @NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
  })
  export class AppRoutingModule { }
  </code></pre>
  
  <p><strong>stories.service.ts</strong></p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Http } from '@angular/http';
  import { map, tap } from 'rxjs/operators';
  
  import { BehaviorSubject } from 'rxjs';
  
  @Injectable({
    providedIn: 'root'
  })
  
  export class StoriesService {
  
  
    private _stories = new BehaviorSubject&lt;any&gt;(null);
    public stories = this._stories.asObservable();
  
  
    storyIdCounter = 0;
    stageIdCounter = 0;
    stateIdCounter = 0;
  
    constructor(private http: Http) { 
      this.getStoriesForReal().subscribe(
        (stories) =&gt; {
          console.log(stories);
          this._stories.next(stories);
        });
    }
  
    getStoriesForReal() {
      return this.http.get("http://localhost:3001/test").pipe(
        tap(res =&gt; console.log(res)),
        map((response) =&gt; response.json())
      );
    }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>stories.component.ts</strong></p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { Story } from '../../interfaces/story';
  import { StoriesService } from '../../services/stories.service';
  
  
  @Component({
    selector: 'app-stories',
    templateUrl: './stories.component.html',
    styleUrls: ['./stories.component.scss']
  })
  export class StoriesComponent implements OnInit {
  
    id = 0;
    storiesList: Story[];
  
    constructor(
      private storiesService: StoriesService) { 
      }
  
    ngOnInit() {
      this.storiesList = [];
      this.storiesService.stories.subscribe((stories) =&gt; {
        for (let story in stories) {
          this.storiesList.push(stories[story]);
        }
      });
    }  
  }
  </code></pre>
  
  <p><strong>story.component.ts</strong></p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { StoriesService } from '../../services/stories.service';
  
  
  @Component({
    selector: 'app-story',
    templateUrl: './story.component.html',
    styleUrls: ['./story.component.scss']
  })
  export class StoryComponent implements OnInit {
  
    constructor(
      private storiesService: StoriesService
    ) { 
  
    }
  
    ngOnInit() {
  
    }
  }
  </code></pre>
  
  <p><strong>stage.component.ts</strong></p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  
  import { StoriesService } from '../../services/stories.service';
  
  @Component({
    selector: 'app-stage',
    templateUrl: './stage.component.html',
    styleUrls: ['./stage.component.scss'],
  })
  export class StageComponent implements OnInit {
  
    constructor(
      private storiesService: StoriesService
    ) { }
  
  
    ngOnInit() {
  
    }
  }
  </code></pre>