title: get URL parameter ActivatedRoute Angular
body: <p>In my application for me to know that there is a parameter in my navigation route, I need to configure this route.</p>
  
  <p>I have a component that should not be rendered in <code>&lt;router-outlet&gt;</code>.</p>
  
  <p>This component is a panel that is in the corner of the screen for sending and receiving messages.</p>
  
  <pre><code>const routes: Routes = [
      {
          path: 'chatView/:contactId',
          component: ChatPanelComponent,
          resolve: {
              chat: ChatPanelService
          },
          canLoad: [GuardService],
      },
  ];
  </code></pre>
  
  <p><strong>This way render my component in the center of the screen and I do not want this to happen.</strong></p>
  
  <p>In the module I configured so that when I accessed the route with <code>"chatView /: contactId"</code> I received a parameter to return the data of that contact when I loaded my application.</p>
  
  <p><strong>In my component:</strong> </p>
  
  <pre><code>    ngOnInit(): void {
  
          this._activatedRoute.params.subscribe((params: any) =&gt; {
              if (params.contactId){
                 this._chatPanelService.getContato(params.contactId).then((contact) =&gt; {
                     this.toggleChat(contact);
                 });
              }
          });
  }
  </code></pre>
  
  <p>I would like to know if there is a way I can get this parameter without having to render this component in the <code>&lt;router-outlet&gt;</code> output, because this component is visible in the corner of the screen and thus renders the component twice in my application.</p>
  
  <p><strong>I need a way to get a parameter without rendering the component in the center of the app-root screen.</strong></p>