How to filter a json array in angularjs?
<p>I have two $scope values one is array and the other one is json array</p>

<pre><code>$scope.extensions = ["jpg", "xlsx", "pdf", "docx", "mp4"]

$scope.files ={'exten':"jpg","Value":""filepath/data1.jpg"},{'exten':"pdf","Value":""filepath/data2.pdf"},{'exten':"mp4","Value":""filepath/data3.mp4"},{'exten':"jpg","Value":""filepath/data4.jpg"}
</code></pre>

<p><a href="https://i.stack.imgur.com/HyU3W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HyU3W.png" alt="enter image description here"></a></p>

<p>if i click on jpg box it should show only data1.jpg and data4.jpg</p>

<p>here is my code for the front end</p>

<pre><code>&lt;div style="padding-left: 100px;margin-top: 50px;"&gt;
                &lt;div style="border: 1px solid cornflowerblue; width: 100px; height: 100px;float:left;margin-left: 50px;" ng-repeat="element in extensions"&gt;
                    &lt;button ng-click="showFile(element)"&gt;{{element}}&lt;/button&gt;
                &lt;/div&gt;         
            &lt;/div&gt;
        &lt;br/&gt;


 &lt;div style="border: 1px solid cornflowerblue; width: 900px; height: 300px;margin-left: 50px;margin-top:100px;" ng-repeat="element in extensions"  ng-show="clickFile==element"&gt;
              {{element}}
        &lt;/div&gt;
</code></pre>