我正在进行Ember.JS 2.0升级,并且不知道如何通过HTMLBars样式的绑定属性将bind-attr替换为三元运算符:
public String determineIfCorrectUrlOnPopUp() {
clickOnEmailThisSeller();
// Below Line in your code will switch to the current window by using for each loop
for (String currentWindow: driver.getWindowHandles())
driver.switchTo().window(currentWindow);
{
//Now you are in Popup window and you can get the pop-up window URL here
System.out.println(driver.getCurrentUrl());
driver.close();
}
System.out.println(driver.getCurrentUrl()); // This will return Parent window URL
return driver.getCurrentUrl();
}
如果isCurrent为true,则不会设置活动类:
<li {{bind-attr class="currentPage.isCurrent:active"}}>
作为一种解决方法,我使用if和else会导致错误的代码重复。
答案 0 :(得分:2)
那个active
是currentPage上的一个变量吗?我想是这个:
{{if currentPage.isCurrent currentPage.active}}
或者这个;
{{if currentPage.isCurrent 'active'}}
会起作用。