title: Angular Router navigation
body: <p>In my project in the first component I have an input box, and a button.  </p>
  
  <pre><code>    &lt;div routerLink="questions" (click)="btnClicked(target.value)" class="button"&gt;Click Me&lt;/div&gt;  
  </code></pre>
  
  <p>In the <code>app.module.ts</code> I set up the router, and it is working this way, but the problem is that in the <code>btnClicked()</code> function I'm checking <strong>if the user input is valid</strong>, and this way, it doesn't matter if the input is valid or not, the program will navigate to the <code>questions</code> component, so I'd like to do this routing in the <strong>typescript file</strong>, right after the validation.  </p>
  
  <p>Any suggestions? Thank you guys for the answer(s).</p>