title: Angular/Typescript - Event, change number with constructor
body: <p>I'm new to Angular and TypeScript, hence the following question and my approach in general might be stupid:</p>
  
  <p>I'm currently working on a bootstrap carousel with a previous &amp; next arrow. To make it work, my first and yet only intention was to create an event. The event for my prev-arrow calls the constructor "prevClick()". I declared a variable and a property called "imagePath" which I'm going to call later in HTML via property binding. Now everytime the arrow is clicked, i shall be increased or decreased by one (if i is 1, it shall jump to the last image, which is image3). According to Augury this works just fine and i is changing with every click - but somehow the i inside of the path isn't.</p>
  
  <p>Do you have any suggestion or is there a better approach? </p>
  
  <pre><code>export class CarouselComponent implements OnInit {
  
        i = 1;
  
        imagePath = 'assets/images/image' + this.i + '.jpg';
  
  
        prevClick() {
          if (this.i === 1) {
            this.i = this.i + 2;
          } else {
            this.i = this.i - 1;
          }
        }
  </code></pre>
  
  <p>Thanks in advance,
  Tim</p>