我对Angular2有点新鲜。
GetYapiBelge() {
var filterInfos = new Array<FilterInfo>();
filterInfos.push(this.AddFilterInfo(General.Syscd, "SYSCD"));
filterInfos.push(this.AddFilterInfo(this.YapiBelgeTurId, "YPBLGTRID"));
this._ServiceIslemlerSvc.GetYapiBelgeBasvuruByFilter(filterInfos).subscribe((result) => this.GetYapiBelgeBasvuruByFilterCompleted(result));
}
GetYapiBelgeBasvuruByFilterCompleted(result: any)
{
this._ActiveYapiBelgeBasvuruBec = result;
$('#dtYapiBelge').DataTable();
$('.collapse')
.on('shown.bs.collapse', function () {
$(this)
.parent()
.find(".fa-plus")
.removeClass("fa-plus")
.addClass("fa-minus");
})
.on('hidden.bs.collapse', function () {
$(this)
.parent()
.find(".fa-minus")
.removeClass("fa-minus")
.addClass("fa-plus");
});
}
js代码是关于我的网格。我找到了一些库并使用它。 当我添加所有clomns的项目hardway时,它工作。但我得到他们的服务,它不起作用。
当我首先调试它时,我可以看到js代码对我的网格的影响,但是在获取项目之后它就消失了。我在我的HTML端使用ngFor我认为我需要一些东西,使得在完成后触发js代码或者其他东西那样的。
对此有任何想法吗?
答案 0 :(得分:1)
* ngFor保留一个布尔变量&#39; last&#39;识别数据是否是最后的。因此,只需将该值赋给变量,如果为真,则调用函数。检查以下代码行。这可能会对你有帮助。
Currentbilltab.getAttribute("class");
答案 1 :(得分:0)
确保在HTML中使用正确的 ngFor 格式,没有其他指令绑定到同一个元素,并且您正在迭代的变量是一个数组。
{{1}}
您的课程不需要为 ngFor 执行任何特殊操作。