Array is not going to bind in UI,Here in following example  

In the Html i'm using the **dataTables**  

> 
> **$scope.successMessage** variable also not binding to UI
> 
> 
> 

I have tried lot of ways but it's not working

Html Page:

```
<div class="box-body table-responsive">
   <table id="mktable" datatable="ng" class="table table-bordered"
      dt-options="dtOptions">
      <thead>
         <tr>
            <th>Account Number</th>
         </tr>
      </thead>
      <tbody>
         <tr ng-repeat="rows in accNum">
            <td>{{rows.ID}}</td>
         </tr>
      </tbody>
   </table>
</div>

```

In JS, I have following code:

```
 mApp.controller('mobileNumberCtrl', function($scope, $rootScope, $state, $compile, DTOptionsBuilder, $location, Connect) {

 $scope.accNum = [];
 $scope.wId = {};
 $scope.dtOptions = DTOptionsBuilder.newOptions()
     .withDisplayLength(10).withOption('scrollX', '100%');

 var requestURL = "http://10.80.49.149:8080/PhonePeService/firstReq";

 $scope.getAccNum = function() {

     for (var i = 0; i < $rootScope.accNumList.length; i++) {
         var wId = {
             ID: $rootScope.accNumList[i]
         }
         $scope.accNum.push(wId);
         console.log($scope.accNum);
     }

     return $scope.accNum;
 }

 Connect.getDataFromServer(requestURL, getDetailsRequest)
     .success(function(response, data, status, headers, config) {

         if (response.TranIdValRes.TranValRes.Status.toUpperCase() == "SUCCESS") {

             $rootScope.accNumList = response.TranIdValRes.TranValRes.AccNum;

             $scope.successMessage = "success";
             $scope.getAccNum();

             $scope.accNum = JSON.stringify($scope.accNum);

             $state.go('firstRes');

         } else {
             $("#errorModal").modal("show");
             $scope.error = "No records available in system."
         }

     }).error(
         function(data, status, headers, config) {
             // do something
             console
                 .log("Unable to contact server. Kindly try again later");
             alert("failure");
             // $scope.error = "We are facing
             // some technical issues while log
             // out. Please Login after
             // some time.";

         });

```

}
 });

In app.js,I have following code:

```
.state("firstRes", {
                  cache: false,
                  url:'/firstRes',
                  views:{

                      content : {templateUrl: 'templates/firstRes.html',controller: 'mobileNumberCtrl'}
                  }
                }) 

```

What is the problem in above lines of code?