<input id="idInputCrux" [(ngModel)]="productList.keyWords" (keyup)="($event.which === 13) ? getProductList() : 0" placeholder="搜索商品名稱(chēng)/價(jià)格/條碼">
<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統(tǒng)稱(chēng)為angularJs
angular 2.0后 統(tǒng)稱(chēng)為 angular,未做特殊版本說(shuō)明,文中所述皆為2.0后的版本
關(guān)于 下面這段代碼新版里面已經(jīng)不再支持了除抛,新版語(yǔ)法參考后面的寫(xiě)法
<input type="text" ng-model="text1" ng-keyup="enterEvent($event)" />
這里已經(jīng)替換成如下操作:
/*input的鍵盤(pán)事件*/
<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="搜索商品名稱(chēng)/價(jià)格/條碼">