title: use angular component function as callback in settings object
body: <p>Question might be easy but I'm quite stuck with it.</p>
  
  <p>I have a <code>chartjs</code> options object. There is a callback function within it.</p>
  
  <p>I need to use some component's variable in that function (<code>this.period</code>).</p>
  
  <p>Is something like this possible ?</p>
  
  <p><strong>Component code:</strong></p>
  
  <pre><code> @Input() period: string;
  
   public lineChartOptions: any = {
      responsive: true,
      // maintainAspectRatio: false
      scales: {
        xAxes: [{
          ticks: {
            max: 10,
            callback: (function(value, index, values) {
              this.wrapperXAxisCallback(value, index, values)
            })
          }
        }],
      }
    };
  
    wrapperXAxisCallback(value, index, values) {
      switch (this.period) {
        case '24hr':
          ..... break;
        case 'week':
          ..... break;
      }
    }
  </code></pre>