最初在輸入字段按鈕中輸入數據後按鈕被禁用是否啓用瞭如何在AngularJS中解決這個問題?如何在用戶沒有在AngularJS的輸入字段中輸入任何數據時禁用按鈕?
$scope.productKeyId = [];
\t \t \t \t \t \t var productKey = [];
\t \t \t \t \t \t $scope.user = {};
\t \t \t \t \t \t $scope.createAlbumDialog = function(event, productObj) {
//Disable clicked button and other..
//$(event.currentTarget).parents(".resetIt").toggleClass("fadeAndDisable", true);
$scope.productKeyId = productObj.keyId;
$scope.albumName = $scope.user.userSearchInProduct;
console.log("productKey :: " + $scope.productKey + " albumName :: " + $scope.albumName);
var PRODUCT_DB_REF = firebase.database().ref('datastore/productsAlbum');
PRODUCT_DB_REF.push({
productKey : [$scope.productKeyId],
albumName : $scope.albumName,
sellerUserTypeKeyId : Number(AUTH.userTypeKeyId)
});
\t \t \t \t \t \t \t //Disable clicked button and other..
\t \t \t \t \t \t \t //$(event.currentTarget).parents(".resetIt").toggleClass("fadeAndDisable", false);
\t \t \t \t \t \t }
<div class="w3-center">
<button type="button" rel="tooltip" class="btn btn-rose btn-xs"
ng-click="createAlbumDialog($event, productObj)">
<i class="material-icons">add</i>Create Album
</button>
</div>
請格式化您的代碼,它真的很難閱讀 – Mistalis