我有一个输入字段,在输入时我想搜索项目并在后台搜索时禁用文本字段,以便不再有字母可以输入该输入,但是在完成搜索功能时,焦点应该是是搜索输入字段,以便用户可以开始输入。
HTML
<input [disabled]="(displayLoader > 0)" [ngModel]="''" (ngModelChange)="updateData($event)" class="form-control-search" placeholder="Search"/>
组件:
updateData(event) {
this.displayLoader = 1
//search function
//on completion
this.displayLoader = 0;
}
这里我使用了disabled,但是在完成时它没有聚焦输入字段,也不能在用户手动点击输入字段之前键入。
答案 0 :(得分:2)
试试这段代码。这有帮助。 html
updateData(event,el) {
this.displayLoader = 1
//search function
//on completion
this.displayLoader = 0;
el.focus();
}
<强>组件强>
public static void ProcessBlob([BlobTrigger("mycontainer/{name}")] CloudBlockBlob blob, string name)
{
Console.WriteLine("before check:" + blob.Properties.ETag);
if (CheckETagExists(blob.Properties.ETag))
{
//Do nothing
}
else
{
//Modify this blob
//...
//After modified this blob, save the ETag of this blob to a place.
blob.UploadText("abcdefg");
SaveETag(blob.Properties.ETag);
Console.WriteLine("Save:" + blob.Properties.ETag);
}
}
public static bool CheckETagExists(string etag)
{
return ModifiedBlobETags.Contains(etag);
}
public static void SaveETag(string etag)
{
ModifiedBlobETags.Add(etag);
}
public static List<string> ModifiedBlobETags = new List<string>();