title: How to search a database value from angular 2?
body: <p>I have an angular2 application and want to add a search function.</p>
  
  <p>I have added a TextBox and a button. The button click get's the value from that textbox and pass it to backend(built in express framework).</p>
  
  <p>My code as below.</p>
  
  <pre><code>&lt;input type="text" name="search" class="form-control" formControlName="search/&gt; 
  &lt;button type="submit" name="button"(click)="search()"&gt;Search&lt;/button&gt;
  </code></pre>
  
  <p>Then the button click event,</p>
  
  <pre><code>search(){
    const activity = {
    search: this.form.get('search').value,
  }
  this.Service.getSearch(activity.search).subscribe(data =&gt; {
    this.activitylist = data.activities;
  </code></pre>
  
  <p>Then there's a service class to access the backend. How i am do this is, I'm using params. to get the value from the backend.</p>
  
  <p>Now i want to do this query. </p>
  
  <p>Give my url a rest url format.</p>
  
  <p>When someone search, URL Should be like</p>
  
  <pre><code>'/allActivities?search='+search
  </code></pre>
  
  <p>something like this?</p>
  
  <p>Can somebody tell me how to do this? How to pass this from angular 2 front end to express API?</p>