I have a question , how we can achieve this with angularjs.
## Html ##
<input ng-model="text" ng-change= "datashow(text)">
<div ng-show="showit" ng-init="showit = false">
//contains data i got from scope
{{ query }}
</div>
## JS: ##
$scope.datashow=function(text){
if(text.length > 0)
$http.post('url' ,text).sucess(function(data){
$scope.showit = true;
$scope.query = data;
});
}else{
$scope.showit = false;
}
}
So this is the data i get whenever my user search for it. If he clicked outside the div then how can i hide that showit class.
What would be the best practices to do it in Angular Way!!!