我有一个带ngModel
绑定的文本框,如下所示:
<input type="text" ng-model="typing" />
和这个texbox的价值
value: {{ typing }}
我希望模型延迟在我输入时更新值.也许如果我停止输入500ms,模型将更新所有值(我在文本框中键入的所有内容).我做了一些谷歌,但没有运气.安永有什么想法?请帮忙.
编辑
这个Angularjs:input [text] ngChange在值发生变化时触发,不能为我的情况提供解决方案.它会在模糊后带来解决方案更新值,但我希望在停止输入后更新值,而不是模糊文本框.
编辑2(答案)
对于角度版本1.4,指令ngModelOptions
在我的情况下很有用.我可以像这样编写,<input ng-model="typing" ng-model-options="{ updateOn: 'default', debounce: {'default': 500, 'blur': 0} }" />
将更新值延迟到默认的500ms模型,如果丢失焦点则立即更新.
我在尝试使用ASP.NET MVC 3.0进行路由时遇到问题.我声明了以下路线:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "RsvpForm", id = UrlParameter.Optional }
);
routes.MapRoute(
"TestRoute",
"{id}",
new { controller = "Product", action = "Index3", id = UrlParameter.Optional }
);
routes.MapRoute(
"TestRoute2",
"{action}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
Run Code Online (Sandbox Code Playgroud)
当我访问时:
http://localhost
Run Code Online (Sandbox Code Playgroud)
该网站工作正常,似乎在Default
路线上.
当我访问时:
http://localhost/1
Run Code Online (Sandbox Code Playgroud)
我得到了404:
'/'应用程序中的服务器错误.
无法找到该资源.说明:HTTP 404.您要查找的资源(或其中一个依赖项)可能已被删除,名称已更改或暂时不可用.请查看以下网址,确保拼写正确.
请求的URL:/ 1
以下是这些路线对应的操作:
public ActionResult Index3(int? id)
{
Product myProduct …
Run Code Online (Sandbox Code Playgroud) 我尝试按照以下链接:http://www.seleniumhq.org/docs/03_webdriver.jsp
在SetUpTest
:
protected IWebDriver driver;
protected ISelenium selenium;
[SetUp]
public void SetupTest()
{
driver = new FirefoxDriver();
selenium = new DefaultSelenium(
"localhost",
4444,
"*chrome",
"http://localhost");
selenium.Start();
verificationErrors = new StringBuilder();
}
Run Code Online (Sandbox Code Playgroud)
当这一行driver = new FirefoxDriver();
执行时,我有这个错误:
Additional information: Cannot find a file named '***[Link to my project]\webdriver.xpi' or an embedded resource with the id 'WebDriver.FirefoxExt.zip'.
Run Code Online (Sandbox Code Playgroud)
当我将其更改为时driver = new ChromeDriver();
,它会打开firefox
,但是虽然元素已经渲染,但它找不到元素.
如何让硒与firefox一起使用?
我有一个存储过程返回一个值(例如:GetData
)
如何在另一个函数中声明一个变量来获取该值?
像这样的东西
Create Function Test
Return Int
Begin
Declare @data My_Data_Type
Declare @count int
SET @data = exec GetData
Select @count = count(*)
From @data
Return @count
End
Run Code Online (Sandbox Code Playgroud)
请帮我 !!!!