title: Angular - Cant able to load div properly after updating $scope
body: <p>Here I am creating a searchable dropdown. When you search and select we need to display the selected content. When i selected one check box its showing after the next event. Here is my sample code. (Problem is displaying the selected content)</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  
      &lt;body&gt;
  
      &lt;div ng-app="myApp" ng-controller="myCtrl"&gt;
  
          &lt;input style="float:left" type="text" name="input" placeholder="Search for IP.." value="" ng-keyup="filter()" ng-model="textInput"&gt;
  
  
          &lt;br&gt;
          &lt;div ng-repeat="option in filteredArray"&gt;
              &lt;label&gt;&lt;input class="Checkbox" type="checkbox" value={{option}} name="filtered" ng-model="event" ng-click="eventListen()"&gt;{{option}}&lt;br&gt;&lt;/label&gt;
          &lt;/div&gt;
          &lt;div ng-repeat="option in favorite" ng-show="afterSelected"&gt;
              &lt;input type="button" value={{option}}&gt; 
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;script&gt;
          var app = angular.module("myApp", []);
  
          app.controller("myCtrl", function ($scope) {
              $scope.Options = ["Apple","Banana","Orange","Jackfruit","Pineapple"]
              $scope.afterSelected = false;
  
              $scope.filter = function () {
                  $scope.filteredArray = [];
                  for (var i = 0; i &lt; $scope.Options.length; i++) {
                      if($scope.Options[i].indexOf($scope.textInput) !== -1) {
                          $scope.filteredArray.push($scope.Options[i]);
                      }
                  }
              }
              $scope.eventListen = function () {
                  $(document).ready(function(){
                      $scope.afterSelected = true;
                      $scope.favorite = [];
                      var string = "";
                      $("input[name='filtered']:checked").each(function(){            
                          $scope.favorite.push($(this).val());
                      });
                  });
              }
          })
      &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>