Data binding not working in Selectbox view template

My View Code file settings.html:

<select ng-model="language" ng-options="item.ID as item.NAME for item in allLanguages">

Below is the code in my controller JS file.

var app = angular.module('index.controllers', ['ionic']);

app.run(function($rootScope, $ionicModal) {
    $rootScope.allLanguages = [{
            'ID': "en",
            "NAME": "English"
        }, {
            'ID': "ta-IN",
            "NAME": "Tamil"
        }];

    $rootScope.language = $rootScope.allLanguages[1];

    $ionicModal.fromTemplateUrl('templates/settings.html', {
       scope: $rootScope,
       animation: 'slide-in-up'
    }).then(function(modal) {
       $rootScope.modal = modal;
    });


    $rootScope.showSettings = function() {
        $rootScope.modal.show();
    }

    $rootScope.closeSettingsModal = function() {
        // always empty object here
        console.log("Lang:" + JSON.stringify($rootScope.language));

        $rootScope.modal.hide();
    }
}

QUESTION:

The allLanguages object array which is assigned to the rootScope is accessed by the template view file defined as settings.html. Values are populated in the select box using that array. so this confirms one way of data binding is working fine.

But in my code $rootScope.language is always empty. The updated value is not present in it. what I am doing wrong?

PS: This code is part of a large app and so it's difficult to isolate it to create a fiddle and reproduce the error.

My guess is that you are missing a dot. Since there are probably layers of Scopes between $rootScope and your ng-model directive. The ng-model will create the "language" variable on the first scope it encounters and won't delegate up to the $rootScope to search. If my guess is right solution is easy and requires only an object attached to $rootScope to which you will attach the language variable.

$rootScope.someObject = { language: '' }

and use it in template like this ng-model="someObject.language"