目的
我试图让管理员和客户在不同阶段展示,管理员可以在点击后发布数据toggleShowDiv(),这样客户就可以看到数据.
题
怎么!isAdmin()进入ng-if?目前,我只是isAdmin默认.
可以通过TD(逐行)将其发布到表TD中吗?不确定,我在这里写正确的代码.
我的想法
我可以使用ng-if每个单独的,TD = isAdmin()还是!isAdmin通过点击功能控制?
$scope.showDiv = isAdmin();
$scope.toggleShowDiv = function (auction) {
var title = 'text.......';
var text = 'are you sure?';
ConfirmModal(title, text, function () {
$scope.showDiv = !isAdmin() ;
});
};
Run Code Online (Sandbox Code Playgroud)
HTML
<div ng-if="showDiv">
<tbody class="auction-group" ng-repeat="a in foos">
<td ng-if="isAdmin()">
<input type="checkbox" ng-click="toggleShowDiv()" />
</td>
</div>
Run Code Online (Sandbox Code Playgroud)
更新
isAdmin() 只是从后端传递的函数.
function isAdmin() {
return !!($aScope.currentUser && $aScope.currentUser.isAdministrator);
}
Run Code Online (Sandbox Code Playgroud)
请注意:问题不在于 …
最近,在使用 selenium firefox 驱动程序时遇到了这个问题。提前致谢
设置
os.name: 'Mac OS X',
os.arch: 'x86_64',
os.version: '10.12.6',
java.version: '1.8.0_131'
Firefox 版本56.0.1(64 位)
Gecko 驱动程序 最新 0.19.0
错误显示失败:org.openqa.selenium.SessionNotCreatedException:试图在没有建立连接的情况下运行命令
我尝试了不同的方法来解决它,但总是出现相同的错误。1.更新所有selenium测试驱动到最新2.指定目录export PATH = $PATH driverDir
我的代码
package automationFramework;
import org.apache.commons.io.FileUtils;
import org.junit.*;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.safari.SafariDriver;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.assertEquals;
public class GeckoDriver {
private static WebDriver driver;
public static int random = 0;
private String baseURL;
// @BeforeClass : Executes only once …Run Code Online (Sandbox Code Playgroud)