title: Uncaught (in promise): TypeError: Cannot read property 'component' of null
body: <p>Getting this error when trying to use nestet route in Angular 4:</p>
  
  <pre><code>ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'component' of null
  TypeError: Cannot read property 'component' of null
      at PreActivation.webpackJsonp.../../../router/@angular/router.es5.js.PreActivation.traverseRoutes (http://localhost:4200/vendor.bundle.js:77976:71)
      at http://localhost:4200/vendor.bundle.js:77954:19
      at Array.forEach (native)
      at PreActivation.webpackJsonp.../../../router/@angular/router.es5.js.PreActivation.traverseChildRoutes (http://localhost:4200/vendor.bundle.js:77953:29)
      at PreActivation.webpackJsonp.../../../router/@angular/router.es5.js.PreActivation.traverseRoutes (http://localhost:4200/vendor.bundle.js:77985:22)
  </code></pre>
  
  <p>This is my routing code:</p>
  
  <pre><code>const appRoutes: Routes = [
      {
          path: '',
          component: HomeComponent
      },
  
      {
          path: 'sobre',
          component: SobreComponent
      },
      {
          path: 'c/:concurso', component: ConcursoItemComponent
  
          , children: [         
              {
  
                  path: ':cargo',
                  component: CargoItemComponent,
  
  
                  children: [
                      {
                          path: ':disc',
                          component: DisciplinaItemComponent,
                          children: [{
                              path: ':assunto',
                              component: AssuntoItemComponent
                          }]
                      }
                  ]
  
              }
          ]
      },
  
  ];
  </code></pre>
  
  <p>I want to make the following nested rules, each one using the variables to inform the nested components of each route:</p>
  
  <p>/</p>
  
  <p>/c/:concurso/</p>
  
  <p>/c/:concurso/:cargo/</p>
  
  <p>/c/:concurso/:cargo/:disc/</p>
  
  <p>/c/:concurso/:cargo/:disc/:assunto</p>
  
  <p>On each level, I will need all the upper variables to make the correct querying of the related objects of the API.</p>
  
  <p>Thanks for any help!</p>