Populating ion-list with contacts

I am creating a IONIC ANDROID APP using cordova-plugin-contacts plugin to read the contacts and display them in ion-list.


<!DOCTYPE html>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

    <link href="lib/ionic/css/ionic.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">

    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
  <body ng-app="starter" ng-controller="CListControl">

      <ion-header-bar class="bar-royal">
        <h1 class="title">Contact Reader</h1>
        <button class="button" ng-click="showcontact()">Add New Contact</button>
      <h3 id="Data">Welcome to my app created by Ionic Cortova !! Yeh !!! Hello</h3>

        <ion-list >
            <ion-item ng-repeat="item in CListItems">




// Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
angular.module('starter', ['ionic','starter.controllers'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
    if(window.StatusBar) {


angular.module('starter.controllers', [])
    .controller('CListControl', function ($scope) {

        $scope.CListItems=[{displayName: 'Mohit'}];

        //funtion to add items to the existing list
        $scope.showcontact = function() {
            console.log("before event");
        document.addEventListener("deviceready", init, false);

        function init() {
            var options      = new ContactFindOptions();
        options.multiple= true;
        options.hasPhoneNumber = true;
        var fields       = [navigator.contacts.fieldType.displayName,navigator.contacts.fieldType.phoneNumbers];
        navigator.contacts.find(fields, gotContacts, errorHandler, options);
        console.log("init end");

        //Error Alerting
        function errorHandler(e) {
        alert("errorHandler: "+e);

        //Script to remove all the contacts without phonenumber.

        function gotContacts(c) {

        var i=0;
        while (i<len)
            if (c[i].phoneNumbers==null)
                if (i!=0)   {i-=1;}

        alert("Found:"+$scope.CListItems.length+" Contacts");



My Output:-

The app starts fine, upon clicking the Add New Contact button, after some time I am getting an alert showing me the no of contacts. But only 1 item in the ion-list is showing i.e. ‘Mohit’.

But when I click the Add new Contact button again, all the contacts are populated in the ion-list.

My Problem:-

As I explained, I think the app is working 1 click behind. Any Ideas whats causing that.

I am new to ionic framework and also javascript so please point me out if its a simple mistake.

Thank you.