我是新手,所以我只想采用简单的方法从输入字段中获取值并将其传递到锚标记中的路由器链接中。
<div>
<form [formGroup] class="form-inline my-2 my-lg-0">
<input
class="form-control mr-sm-2"
type="text"
placeholder="Search"
name="searchValued"
[(ngModel)]="searchedValue">
<a [routerLink]="['/getSearchedBusiness', searchedValue]" class="btn btn-primary">Search</a>
</form>
</div>
答案 0 :(得分:0)
由于您想使用一种简单的方法,因此不需要with cte as (
select transactionno from tablename where id = 1000
)
update tablename
set transactionno = (select transactionno from cte) + id - 1000
where id > 1000 and id <= 2000
。您可以仅使用form
来实现所需的功能。因此,几乎就像您一样:
component.html
[(ngModel)]
您也可以这样做:
<input
class="form-control"
type="text"
placeholder="Search"
[(ngModel)]="searchedValue">
<a [routerLink]="['/getSearchedBusiness', searchedValue]" class="btn btn-primary">Search</a>
在您的component.ts中:
<a routerLink="/getSearchedBusiness/{{ searchedValue }}]" class="btn btn-primary">Search</a>
答案 1 :(得分:0)
当从代码中删除表单元素时,效果很好
WHERE Url LIKE '%ID=%'