單擊拍照 button ,執(zhí)行該函數(shù) getPhoto() ,窗體執(zhí)行的函數(shù) funcSubmit() ng-submit 自動。 什么會需要更改,以防止這種情況發(fā)生?它執(zhí)行的功能只有 getPhoto() 而無需運(yùn)行 ng-submit 的形式。
Ps.: 這段代碼是應(yīng)用程序的一部分 android 移動,用離子框架開發(fā)
<ion-view title="OS"> <form ng-submit = "funcSubmit()"> <ion-content class="has-header"> <ion-list > <ion-item > <button name="fota" class="button button-block button-positive" ng-click="getPhoto()"> <i class="icon ion-ios7-camera"> Photo</i> </button> </ion-item > </ion-list > </ion-content> <div class="bar bar-footer bar-stable"> <button name="canc" class="button button-light" ui-sref="app.padronis">Cancel</button> <button name="subm" class="button button-light" type="submit">Save</button> </div> </form> </ion-view>
解決方法 1:
使用方法:
<input type="button" name="fota" ng-click="getPhoto()">
因為 <button> 會自動調(diào)用提交。
以上所述就是本文的全部內(nèi)容了,希望大家能夠喜歡。
新聞熱點
疑難解答
圖片精選