I'm relatively new to Angular, and suspect I am not grasping a concept.
What I want to do: Load main view. Click a button on main view which loads a different view. Use jQuery (or any other method) to return an input field in that new view, so I can change the text of the input.
Angular view, which loads after I click a button in the main view:
<input type="text" id="contact_name" ng-model="contact_name"></input>
Function that is supposed to change the text of the input field
function loadInputs(){
$('#contact_name').val('test'));
}
What I tried so far, both of these are being called from the controller:
$scope.$on('$routeChangeSuccess', function () {
loadInputs();
});
and
$scope.$on('$viewContentLoaded', tempContact.loadInputs());
Neither of which worked. What is the "angular way" of doing this?