title: Grouping Alerts in Angularjs
body: I want to group alerts based on notificationSubject. If
  > notificationSubject key value length(dosMinus) > 1 means it will
  > display in first div and  notificationSubject key value length (DOS
  > etc) == 1 means it will display in second div For example, following
  > json contains notificationSubject = dosMinus are there in 2 times and
  > remaining each one record. I want to display 'dosMinus' in 1st div and
  > remaining alerts in 2nd div.
  
  ** -->
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var myapp = angular.module('myapp', []);
  myapp.controller('myctrl', ['$scope', function ($scope) {
      $scope.alerts = {
          "DISPLAY_ALERT_DETAILS": [
              {
                  "alertRaisedUserId": 1215
                  , "source": 1
                  , "clientTimestamp": 1492732800000
                  , "severity": "low"
                  , "createdByMe": "Y"
                  , "notificationSubject": "dosMinus"
                  , "notificationDetails": "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
      }
  
          , {
                  "alertRaisedUserId": 1215
                  , "source": 1
                  , "clientTimestamp": 1492732800000
                  , "severity": "low"
                  , "createdByMe": "Y"
                  , "notificationSubject": "dosMinus"
                  , "notificationDetails": "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
      }
  
          , {
                  "alertRaisedUserId": 1215
                  , "source": 1
                  , "clientTimestamp": 1492992000000
                  , "severity": "low"
                  , "createdByMe": "Y"
                  , "notificationSubject": "DOS"
                  , "notificationDetails": "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"
      }
          , {
                  "alertRaisedUserId": 1215
                  , "source": 1
                  , "clientTimestamp": 1492992000000
                  , "severity": "informational"
                  , "createdByMe": "Y"
                  , "notificationSubject": "EO"
                  , "notificationDetails": "Lorem Ipsum is simply dummy text of the printing"
      }
          , {
                  "alertRaisedUserId": 1215
                  , "source": 1
                  , "clientTimestamp": 1492992000000
                  , "severity": "informational"
                  , "createdByMe": "Y"
                  , "notificationSubject": "Late Sales Orders"
                  , "notificationDetails": "It has survived not only five centuries"
      }
          , {
                  "alertRaisedUserId": 1215
                  , "source": 1
                  , "clientTimestamp": 1492992000000
                  , "severity": "informational"
                  , "createdByMe": "Y"
                  , "notificationSubject": "Late Purchase Orders"
                  , "notificationDetails": "It was popularised in the 1960s with "
      }
          , {
                  "alertRaisedUserId": 1215
                  , "source": 1
                  , "clientTimestamp": 1492992000000
                  , "severity": "informational"
                  , "createdByMe": "Y"
                  , "notificationSubject": "Demand"
                  , "notificationDetails": "It was popularised in the 1960s with the release of Letraset sheets containing "
      }
          , {
                  "alertRaisedUserId": 1215
                  , "source": 1
                  , "clientTimestamp": 1492992000000
                  , "severity": "informational"
                  , "createdByMe": "Y"
                  , "notificationSubject": "Spend"
                  , "notificationDetails": "more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      }
          , {
                  "alertRaisedUserId": 1215
                  , "source": 1
                  , "clientTimestamp": 1492992000000
                  , "severity": "informational"
                  , "createdByMe": "Y"
                  , "notificationSubject": "Inventory"
                  , "notificationDetails": "It was popularised in the 1960s with the release of Letraset "
      }
      ]
      }
  }]);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html ng-app="myapp"&gt;
  
  &lt;head&gt; &lt;/head&gt;
  
  &lt;body ng-controller="myctrl"&gt;
      &lt;div&gt; 1. Div (Display dosMinus)&lt;/div&gt;
      &lt;div&gt; 2. Div (Display DOS....Etc)&lt;/div&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>