angulartics2 事件不起作用

angulartics2 event does not work

我正在使用 angulartics2

import { Component } from '@angular/core';
import { Angulartics2On } from 'angulartics2';

@Component({
  selector: 'random-component',
  directives: [Angulartics2On],
  template: `
    <button angulartics2On angularticsEvent="Play" angularticsCategory="Videos" (click)="onClick()">Play</button>
  `
})
export class RandomComponent {
  onClick() {
    console.log('Hi');
  }
}

对我不起作用。 Google Analytics Debugger 和 Google Analytics Real-Time 报告中不显示效果。

这可能是什么原因造成的?谢谢

我在 github 从 @JonnyBGod 那里得到了 answer,谢谢!

我需要将 angulartics2On 更改为 angulartics2On="click"

但自从this PR,在v1.1.1中,我们只能使用angulartics2On,默认事件将是click