我有一个检查值是true还是false的函数以及一个改变值的函数。
checkValue(item){
if item.exists{
return 1;
}
else {
return 0;
}
}
在我的html中,我有一个ng-repeat
按此函数命令:
<span ng-repeat="item in items | orderBy: checkValue"></span>
<a ng-click="changeItemExists(selectedItem)">
现在,当item.exists
更改orderBy
时,item.exsist
无效并再次订购。
如何让订单查看import java.util.Scanner;
public class week4
{
public static void main(String[] args)
{
{
String studentname;
int mark = 100; // listing maximum mark
Scanner inText = new Scanner(System.in);
System.out.print("Please enter the name of the student >> ");
studentname = inText.nextLine();
Scanner inNumber = new Scanner(System.in);
System.out.print("Please enter mark for student " + studentname + " out of 100 >> ");
mark = inText.nextInt();
if(mark <50) System.out.print("The grade for " + studentname + " is F " );
else if(mark <65) System.out.print("The grade for " + studentname + " is P " );
else if(mark <75) System.out.print("The grade for " + studentname + " is C " );
else if(mark <85) System.out.print("The grade for " + studentname + " is D " );
else System.out.print("The grade for " + studentname + " is HD2" );
}
}
}
?
答案 0 :(得分:0)
您不需要checkValue
功能。
只是做:
<span ng-repeat="item in items | orderBy: 'exists'"></span>
然后,orderBy
会自动刷新订单,并对“存在”进行任何更改。属性。