title: Change image when button with click function is clicked angular
body: <p>I am trying to change an image using Angular when a button is clicked.  I already have the function change text on the page, but am failing to figure out how to change an image.  Each function would have a different image associated with it. I have tried a few variations of this.imgsrc in function but none seem to work.  Edit:  I am trying to have a message and an image displayed in two different spots when the button is clicked.  The message from the code below is displayed at the top and the image I would like displayed would be on the right.  </p>
  
  <pre><code> &lt;div&gt;{{clickMessage}}&lt;/div&gt;
  
   &lt;button (click)="onclick1()" class="button"&gt;1&lt;/button&gt;
   &lt;button (click)="onclick2()" class="button"&gt;2&lt;/button&gt;
   &lt;button (click)="onclick3()" class="button"&gt;3&lt;/button&gt;
   &lt;button (click)="onclick4()" class="button"&gt;4&lt;/button&gt;
   &lt;button (click)="onclick5()"class="button"&gt;5&lt;/button&gt;
  </code></pre>
  
  <p>Component code</p>
  
  <pre><code>export class ChangeStratComponent implements OnInit {
  clickMessage = '';
  constructor() { }
  ngOnInit() {
  }
  onclick1() {
  this.clickMessage = 'click 1';
  }
  onclick2(){
  this.clickMessage = 'Click 2';
  }
  onclick3() {
  this.clickMessage = 'Click 3';
  }
  onclick4() {
  this.clickMessage = 'Click 4';
  }
  onclick5() {
  this.clickMessage = 'Click 5';
  }
  
  }
  </code></pre>