<input id="idInputCrux" [(ngModel)]="productList.keyWords" (keyup)="($event.which === 13) ? getProductList() : 0" placeholder="搜索商品名称/价格/条码">
<a href="javascript:void(0);" class="search-btn" (click)="getProductList()">
<i class="icon"></i>
</a>
.screen-box .search-btn {
display: block;
float: left;
margin: 5px;
border-radius: 3px;
line-height: 32px;
height: 32px;
background-color: #ff5d49;
padding: 0 20px;
}
.screen-box .date-box .text {
float: left;
height: 32px;
line-height: 32px;
width: 30px;
text-align: center;
}
概念陈述:angularjs 1.x统称为angularJs
angular 2.0后 统称为 angular,未做特殊版本说明,文中所述皆为2.0后的版本
关于 下面这段代码新版里面已经不再支持了,新版语法参考后面的写法
<input type="text" ng-model="text1" ng-keyup="enterEvent($event)" />
这里已经替换成如下操作:
/*input的键盘事件*/
<input type="password" maxlength="20" [(ngModel)]="password" class="cla-tex" placeholder="密码"
name="password" (keyup)="($event.which === 13)?login('password'):0">
<input id="idInputCrux" [(ngModel)]="productList.keyWords" (keyup)="($event.which === 13) ? getProductList() : 0" placeholder="搜索商品名称/价格/条码">