[英]angulartics2 event does not work
I am using angulartics2 . 我正在使用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');
}
}
does not work for me. 对我不起作用。 The effect does not show in the Google Analytics Debugger and Google Analytics Real-Time reports.
该效果不会显示在Google Analytics(分析)调试器和Google Analytics(分析)实时报告中。
What may cause this? 是什么原因造成的? Thanks
谢谢
I got answer from @JonnyBGod on github, and thanks! 我从github上的@JonnyBGod得到了答案 ,谢谢!
I need change angulartics2On
to angulartics2On="click"
. 我需要将
angulartics2On
更改为angulartics2On="click"
。
But since this PR , in v1.1.1, we are able to use angulartics2On
only, the default event will be click
. 但是由于此PR ,在v1.1.1中,我们只能使用
angulartics2On
,默认事件将是click
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.