In HTML I have this:
<input id="Search" type="text" placeholder="Search Images.." ng-model="data"
ng-keypress="($event.charCode==13)? searchMore() : return">
This is basically input field which acts as search.
In controller I just receive the value which is passed to input: $scope.data
I want to determine somehow if the search term has changed so that I can wipe out results array if it did or append if just more results of the same search term came.
How to determine that $scope.data now contains a different string? If I will just set something like this:
$scope.savedData = $scope.data
This new variable will be overwritten all the time with new data.