Hi everyone, I’m newbie. I want to create a list, according to inputs.
I put my input and add button. However, I couldn’t add items into list according to inputs.
my html
<ion-view title="Bildirimler" id="page11">
<ion-content padding="true" class="has-header">
<form>
<div class="list">
<label class="item item-input">
<input type="text" placeholder="Notu giriniz.." ng-model="todo.name"></label>
</div>
</form>
<div class="buttons"><button class="button" ng-click="addTodo()">ADD</button></div>
<ion-list show-delete= "data.showDelete">
<ion-item ng-repeat="todo in todos">
{{todo.name}}
</ion-item>
</ion-list>
</ion-content>
</ion-view>
my controller
.controller('bildirimlerCtrl', ['$scope', '$stateParams', '$ionicAuth', '$ionicUser', '$state', '$ionicModal',
function ($scope, $stateParams) {
$scope.data = {
showDelete: false
}
$scope.todos=[
{name: 'clean the kitchen'},
{name: 'clean the room'},
]
$scope.addTodo = function(){
$scope.todos.push({name: ""})
}
}])
How can I do that? Thank you for help from now