Encountering an issue while working with JavaScript in AngularJS. There is a text field identified by id="longitude".
<input type="text" data-ng-model="newwarehouse.longtitude" id="longitude"/>
The value of this field is being set using JavaScript.
var longitudeValue = document.getElementById('longitude');
longitudeValue.value = event.latLng.lng();
However, the Angular JS controller is unable to retrieve the value of this field unless it is manually typed in. How can I adjust my JavaScript to properly set the model value for this field? Thank you for any insight provided.