小编use*_*469的帖子

我可以一起使用ng-click和onclick

我正在研究一个小的angularjs应用程序.我有一个按钮,我正在使用2个事件,ng-click和onlick.它运作正常,没有问题,但我想确保100%我做得很好,我的做法是对的吗?它是否允许在按钮状态事件中将它们组合在一起?

onclick angularjs angularjs-ng-click

10
推荐指数
1
解决办法
2万
查看次数

Find the last index from the array using ngFor

I am using the traditional ngFor for iterating across an array followed with index, my sample code:

<div *ngFor="let object of Objects; let i = index">
Run Code Online (Sandbox Code Playgroud)

I want to know is it possible to get the last index from the array in i? I know I can find the first or any other by if i === 1, etc, but is there a method to check directly if i is the last one from the array? Thanks.

typescript angular

0
推荐指数
1
解决办法
142
查看次数