ngIf также принимает функции.
<div ng-if="checkStatus(task_detail.status)">
Это может быть очень полезно, когда у вас есть несколько кодов или добавлена логика, которая определяет логический результат в вашем ng-if. Я использую это довольно часто.
From the doc:
In a Sub or Set procedure, the Return statement is equivalent to an Exit Sub or Exit Property statement, and expression must not be supplied.
So they're the same in this context.
While there are exceptions like guard clauses, in most cases I would consider either a sign that the method is too long.