var app = angular.module('plunker', []);

app.controller('MainCtrl', function($scope) {
  $scope.name = 'World';
  
  
  $scope.users = [
    {id:1, name:'john'},
    {id:2, name:'barney'},
    {id:3, name:'moroni'},
    {id:4, name:'adam'},
    {id:5, name:'sam'}
  ];
  
  $scope.books = [
    {id:1, regId:1, name:'book1'},
    {id:2, regId:2, name:'book1'},
    {id:5, regId:3, name:'book1'},
    
  ];
  
  angular.forEach($scope.users, function(value, index){
    for(var i =0; i< $scope.books.length; i++){
      if(value.id === $scope.books[i].id){
        value.hasBook = true;
      }
    }
  });
  console.log($scope.users);
  
  
});
<!DOCTYPE html>
<html ng-app="plunker">

  <head>
    <meta charset="utf-8" />
    <title>AngularJS Plunker</title>
    <script>document.write('<base href="' + document.location + '" />');</script>
    <link rel="stylesheet" href="style.css" />
    <script data-require="angular.js@1.5.x" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.11/angular.min.js" data-semver="1.5.11"></script>
    <script src="app.js"></script>
  </head>

  <body ng-controller="MainCtrl">

    <table>
      <thead>
        <th>ID</th>
        <th>NAME</th>
        <th>HAS BOOK</th>
      </thead>
      <tbody>
        <tr ng-repeat="user in users">
          <td>{{user.id}}</td>
          <td>{{user.name}}</td>
          <td>{{user.hasBook}}</td>
        </tr>
      </tbody>
    </table>
  </body>

</html>
/* Put your css in here */