I have a text field, while i start typing, the predefined words should come for selecting.
<input type="text"></input>
i have a list of items. only that should show. how to make it work? controller follows.
angular.module('starter.controllers', [])
.controller('AppCtrl', function($scope, $ionicModal, $timeout, authService, $state, $http,$ionicLoading)
{
$scope.loginSubmitted = false;
$scope.myflag = false;
$scope.User = {};
$scope.toast = function(){
$ionicLoading.show({
template: 'wrong credentials'
});
$timeout(function() {
$ionicLoading.hide();
}, 1000);
}
$scope.doLogin = function() {
$scope.loginSubmitted = true;
$scope.loginstatus==0;
authService.GetByUsername().success(function(data) {
$scope.UserData = data;
console.log($scope.UserData);
for (var i = 0; i < $scope.UserData.length; i++) {
if ($scope.UserData[i].UserName == $scope.User.UserName && $scope.UserData[i].Password == $scope.User.Password) {
$scope.loginstatus=1;
break;
}
}
if($scope.loginstatus==1){
$state.go('app.single')
}
else {
console.log('wrong credentials');
$scope.toast();
}
}).error(function(err) {
console.log(err);
});
}
}).controller('PlaylistsCtrl', function($scope) {
}).controller('EmployeeCntrl', function($scope, $stateParams) {
$scope.names = ["john", "bill", "charlie", "robert", "alban", "oscar", "marie", "celine", "brad", "drew", "rebecca", "michel", "francis", "jean", "paul", "pierre", "nicolas", "alfred", "gerard", "louis", "albert", "edouard", "benoit", "guillaume", "nicolas", "joseph"];
$scope.data = {};
//$scope.data.date = new Date().toDateString();
$scope.data.FromDate = new Date();
$scope.employees = [{name: "vishnu"}, {name: "seenu"}];
$scope.selectedEmployee = $scope.employees[0].name;
$scope.projects = [{name: "crwhy"}, {name: "big in"}];
$scope.selectedProject = $scope.projects[0].name;
$scope.logdata = function(form) {
console.log($scope.data);
}
});
now can u do it as per requirement?