title: How to get id from route params and pass into a service
body: <p>A user clicks a button which should take them to a profile/:id page. In the profile component i try to get the id route params and pass it into my user service to return the user object to print in the html. However, this does not work.</p>
  
  <p>main.component.html</p>
  
  <pre><code>  &lt;button mat-icon-button color="accent" matTooltip="Account" [matTooltipPosition]="toolTipPosition" [routerLink]="['profile', user?._id]"&gt;
                  &lt;mat-icon&gt;account_box&lt;/mat-icon&gt;
            &lt;/button&gt;
  </code></pre>
  
  <p>main-routing.module.ts</p>
  
  <pre><code>  {
      path: 'profile',
      loadChildren: '../profile/profile.module#ProfileModule',
    },
  </code></pre>
  
  <p>profile.component.ts</p>
  
  <pre><code>constructor(private authService: AuthService,
      private route: ActivatedRoute,
      private router: Router,
      private userService: UserService) { }
  
  ngOnInit() {
      this.user = this.route.paramMap.switchMap((params: ParamMap) =&gt; {
          let user_id = params.get('id');
  
          return this.userService.get(user_id);
      });
  }
  </code></pre>
  
  <p>profile.component.html</p>
  
  <pre><code>{{ user?._id}}
  </code></pre>
  
  <p>profile-routing.module.ts</p>
  
  <pre><code>  {
          path: '',
          component: ProfileComponent,
          children: [
              {
                  path: ':id',
                  component: HomeComponent,
                  children:
                  [
                      { path: 'home', component: HomeComponent },
                      { path: 'moments', component: MomentsComponent },
                  ]
              },
  
          ]
      },
  </code></pre>