I'm working on a single page application that has 2 views: home, and a dashboard.
The 'home' state has a search form. When the form is submitted, the dashboard view is loaded using $window.location.assign('/#/dashboard');
.
When the dashboard view is loaded from the search, I need to automatically set a select box value to 0. I have the code to do this, but for some reason, it is not executing when the page loads... I'm thinking this has something to do with Angular adding the new 'select' DOM element to the page when it loads.
dashboard view
<div ng-controller="MainCtrl">
<!-- list all lists -->
<select id="list-select" class="list-select" ng-model="list" ng-options="list as list.title for list in lists">
<option value="">Select List</option>
<!-- when the page loads from search, this will be added...
<option value="0">search</option>
-->
</select>
<!-- end list -->
<hr class="dash">
<!-- words in selected list -->
<ol ng-model="list.words">
<li ng-repeat="word in list.words" id="word-{{word.id}}">
<p>{{ word.title }}</p>
</li>
</ol>
<!-- end words -->
</div>
main.js
$("#list-select").val("0");
Please help!