How to scroll to particular input field when state change from one page to another page using ionic framework

how to scroll to perticular input field when state change from one page to another means when comes back from another page need to auto scroll to perticular input field

After a long RND, I found the following solution for the problem

Here i give you the example for the solution.

in HTML:

first we have to give delegate-handle to ion-content of the page

   <div id="field2_area" class="item-input item-stacked-label">                   
                <span class="input-label">Name</span>
                <input type="text" placeholder="Enter Name"/>                     

   <div id="field1_area" class="item-input item-stacked-label item-button-right">                   
                <span class="input-label">Account</span>
                <input type="text" placeholder="Select Account"/>
                <div class="buttons lookup-btns">
                    <button class="button"  ng-click="selectAcc()">
                        <i class="icon ion-ios-search-strong"></i>
                    <button class="button" ng-click="addAcc()">
                        <i class="icon ion-android-add"></i>

In app.js:

in the main code we have to handle back button event of the mobile and check current screen state and according to that we pass delegate handle of the page to our common scrollTo_Field function

.controller('MainCtrl', function ($scope, $rootScope,$ionicPlatform,$ionicPosition,$ionicScrollDelegate) {

$ionicPlatform.registerBackButtonAction(function (event) {
if ($ == "login") {;
}else if($ == "app.page1"){
}else if($ == "app.page2"){

}, 100);

$rootScope.scrollTo_Field = function (eleArea,pageContent) {
$timeout(function() {
    var elePos = $ionicPosition.position(angular.element(document.getElementById(eleArea)));
    if(pageContent == "page1Content"){        
       $rootScope.page1_scrollView.scrollTo(elePos.left,, true);
    }else if(pageContent == "page2Content"){
      $rootScope.page2_scrollView.scrollTo(elePos.left,, true);
}, 200);


The above code is work for me.