I have a search books page, in which when I click the search tab, depending on the search criteria, it will display the results in the adjacent block. But when I click it second time, it is not working!
The relevant html code of the page:
<form action="#" method="post" ng-controller = "OptionsController as oCtrl">
<select class="selectpicker btn btn-default" name="SearchCriteria" id ="sOptions">
<option value="1">Title</option>
<option value="2">Author</option>
</select>
<label class="searchbox">
<span><br></span>
<textarea id="searchBox" name="searchBox" value="" type="text" autocomplete="on" placeholder="search books"></textarea>
</label>
<input type="button" value="Search" id = "bsearch" class="submit button" ui-sref = ".searchResults">
</form>
<div id = "spaceforresults" ui-view = "" autoscroll="false"> </div>
My angular js code for routing
routerApp.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/home');
$stateProvider
.state('books.searchResults', {
url: '',
templateUrl: 'html/searchResults.html',
controller: 'BookController',
});
So, when I click the search button, the results are popped out as expected. Then If I change the options and click the search button again, it is not routing the view (updating the results). Am I doing anything wrong over here?