簡體   English   中英

用 ng-hide 和 ng-show 隱藏按鈕

[英]hiding the button with ng-hide and ng-show

在這個 angularjs 中的 todo 應用程序中,我需要幫助使用 ng-show 和 ng-hide 衍生物隱藏按鈕。 當文本框為空時。

$scope.addTodo = function () {
    if ($scope.formTodoText.length > 0) 
    {
    $scope.todos.push({text:$scope.formTodoText, done:false});
     $scope.formTodoText = '';
    } 
    else {
    alert('TODO text is empty');
   }     
};

做就是了:

ng-hide="formTodoText.length == 0"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM