0
こんにちは、私は簡単な質問があります。誰も私に説明することができます(クリック)は、HTML要素で動作しないのですか?角4(クリック)が機能していません<i>要素
私は(クリック)タグ内全体番目の要素を配置し、適用することによって、この回避する方法を見つけたtable.component.html
<th>Date of creation <i class="fa fa-sort" (click)="sort()"></i></th>
table.component.ts
import { Component, OnInit } from '@angular/core';
import { DocumentsService } from '../documents.service';
@Component({
selector: 'app-table',
templateUrl: './table.component.html',
styleUrls: ['./table.component.css']
})
export class TableComponent implements OnInit {
constructor() { }
ngOnInit() {
}
sort(){
console.log("test");
}
}
なぜ、これが要素で機能していないのか不思議です。
cssの ''要素に 'pointer-events:none'を適用する可能性はありますか? –
あなたのアイコンは素晴らしいフォントから見えますか?あなたのアイコンがそこにあることを確認してください。代わりに、の間にテキストを入れて、あなたの関数が機能するかどうかを確認してください。 – francojay
あなたのコードに何も問題はありません。さらなる助けが必要な場合は、plunkrを入力してください。 – Zze