How can I ensure the ons-scroller stays at the bottom when writing JavaScript?
This is the code I am using:
<ons-page>
<ons-toolbar>
<div class="left"><ons-back-button>Return</ons-back-button></div>
<div class="center">{{user_msg.title}}</div>
</ons-toolbar>
<ons-scroller id="scroll_msg" threshold="0">
<div ng-repeat="msg in msg_history"
ng-class="getMsgClass(msg.uid)">
<span ng-if="uid == msg.uid ">{{msg.msg}}</span>
<span ng-if="uid == msg.uid " style="color:#336699;">: {{msg.nickname}}</span>
<span ng-if="uid != msg.uid " style="color:#336699">{{msg.nickname}}:</span>
<span ng-if="uid != msg.uid ">{{msg.msg}}</span>
</div>
</ons-scroller>
<ons-bottom-toolbar>
<input type="text" class="text-input ng-pristine ng-valid ng-touched"
placeholder="Enter text message" ng-model="user_msg.message" style="margin:6px;" value="">
<button ng-click="sendUserMessage()">Send</button>
</ons-bottom-toolbar>
</ons-page>