如何在angularjs中使用HTML5地理定位?我可以使用HTML5获取它; 但是如何将它传递给控制器中的angularjs范围?任何样本jsfiddle都会节省我的一天!
javascript geolocation angularjs angularjs-directive angularjs-scope
我正在尝试连接到我的AWS unix机器上安装了FF版本26.0的selenium 2.30,但当我启动访问selenium的客户端时,我收到以下错误.
此外,当我尝试与selenium独立jar 2.38.0相同时,它工作正常,但在一两天的一段时间后突然发生,它开始给出2.38.0以下的错误.不知道为什么会这样?任何的想法??
项目是我有一个多线程应用程序,其中客户端持续执行一些线程,ping一些URL和所有,它继续发生,除非发生如下的一些问题.
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
Error: no display specified
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.4.76-65.111.amzn1.x86_64', java.version: '1.7.0_51'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:197)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:190)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:108)
Run Code Online (Sandbox Code Playgroud) java firefox selenium-grid firefox-addon-sdk selenium-webdriver
我需要计算两个日期之间的天数,我使用下面的代码.问题是它返回我2但实际上它应该返回3因为2016年6月30日到6月27日之间的差异是3.你能帮助它应该包括当前日期以及差异吗?
public static long getNoOfDaysBtwnDates(String expiryDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Date expDate = null;
long diff = 0;
long noOfDays = 0;
try {
expDate = formatter.parse(expiryDate);
//logger.info("Expiry Date is " + expDate);
// logger.info(formatter.format(expDate));
Date createdDate = new Date();
diff = expDate.getTime() - createdDate.getTime();
noOfDays = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
long a = TimeUnit.DAYS.toDays(noOfDays);
// logger.info("No of Day after difference are - " + TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS));
System.out.println(a);
System.out.println(noOfDays);
} catch (ParseException e) {
e.printStackTrace();
}
return noOfDays;
}
Run Code Online (Sandbox Code Playgroud)
到期日为2016-06-30,当前日期为2016-06-27
我有一个低于JSON:
[{"brand":"abc"},{"brand":"xyz"},{"brand":"abc"},{"brand":"abc"},{"brand":"por"},{"brand":"xyz"}]
Run Code Online (Sandbox Code Playgroud)
使用ng-repeat
,我如何显示像 -
Brand Occurances
abc (3)
xyz (2)
por (1)
Run Code Online (Sandbox Code Playgroud)
即品牌名称(同一品牌名称的重复出现次数)?
如何使用离子框架和angularjs实现添加更多表单输入类型的功能?
应该是这样的 -
http://bootsnipp.com/snippets/featured/dynamic-form-fields-add-amp-remove-bs3
我如何使用 ng-repeat 在 UI 上使用 angularJS 迭代来自服务器的 JSON 响应?
$scope.data = {
"Home Needs": [{
"id": 11,
"itemName": "PARLE G 500 Grams",
"itemPrice": 50,
"minSellPrice": 45,
"discount": 0,
"store": "Home Needs"
}],
"SRI SAI Store": [{
"id": 1,
"itemName": "PARLE G 500 Grams",
"itemPrice": 50,
"minSellPrice": 45,
"discount": 0,
"store": "SRI SAI Store"
}],
"Ashirwad": [{
"id": 10,
"itemName": "PARLE G 500 Grams",
"itemPrice": 50,
"minSellPrice": 46,
"discount": 0,
"store": "Ashirwad"
}]
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助我使用 jsfiddle 或指针吗?
谢谢
angularjs angularjs-directive angularjs-scope angularjs-ng-repeat