Hello,
I am having a problem on my Todo List Project using AngularJS. I want that an empty input (there are nothing in the input form) doesn’t appear on the todo list
This is my controller.js snippet
$scope.empty = function() { var emptyTodos = $scope.todos; $scope.todos = []; if ($scope.todoText === null){ $scope.todos.push($scope.todoText); } };
My index.html snippet
> <ul class="unstyled"> > <li ng-repeat="todo in todos | orderBy : $index:true"> > <input type="checkbox" ng-model="todo.done"> > <span class="done-{{todo.done}}">{{todo.text}}</span> > </li> > </ul>
When I use the code above, my todo list is suddenly not working. Whether I inputted something or not and click add, nothing appeared. Are there any solution ?