How to validate JSON data with ng-pattern
<p>My app pulls json data and randomises the results on click, how can i validate each result that get's generated and state whether the value is valid/invalid?</p>

<p>view</p>

<pre><code>  &lt;div ng-controller="idCtrl"&gt;
    &lt;button ng-click="randomize()"&gt;Random value on click&lt;/button&gt;    
    &lt;p&gt;Id Number: &lt;span data-ng-bind="RandomId.number"&gt;&lt;/span&gt;&lt;/p&gt;
    &lt;p&gt;Valid?: &lt;span&gt;&lt;/span&gt; &lt;/p&gt;
 &lt;/div&gt;
</code></pre>

<p>json </p>

<pre><code>[
    {"number": "8607025402081"},
    {"number": "8501016184086"},
    {"number": "6104053425672"},
    {"number": "8909025012083"},
    {"number": "2222222222222"},
    {"number": "8888888888888"},
    {"number": "0000000000000"},
    {"number": "9999999999999"}
]
</code></pre>

<p>script</p>

<pre><code>var idApp = angular.module('idApp', []);
idApp.controller('idCtrl', ['$scope', '$http', function ($scope, $http) {

    $scope.regex = '(((\d{2}((0[13578]|1[02])(0[1-9]|[12]\d|3[01])|(0[13456789]|1[012]) (0[1-9]|[12]\d|30)|02(0[1-9]|1\d|2[0-8])))|([02468][048]|[13579][26])0229))(( |-)(\d{4})( |-)(\d{3})|(\d{7}))'; 

    $scope.randomize = function(){

    $http.get('js/idnumbers.json')
        .success(function(data) {
            $scope.idnumber = data;
            var randomIDIndex = Math.floor(Math.random() * $scope.idnumber.length);
            $scope.RandomId = $scope.idnumber[randomIDIndex];
            console.log(data);
        })};
}]);
</code></pre>