How to filter an Array by Name in AngularJS
<p>In my project I have a table in which I'm looping through an array. I want the user to have options of filtering the table by either showing their data against their name or show all the data.</p>

<p>I have a controller like this:</p>

<pre><code>var app = angular.module('app', []);
app.controller('Ctrl',[], function($scope){
$scope.LoggedInTeacher = 'Papa Johns';
$scope.Teachers = [{Id: 1, Name: 'Patricia Johns' , Subject: 'Science'},
                   {Id: 2, Name: 'Veronica Smith' , Subject: 'Maths'},
                   {Id: 3, Name: 'Clifford Harris' , Subject: 'Music'},
                   {Id: 4, Name: 'Papa Johns' , Subject: 'Catering'},
                   {Id: 5, Name: 'Bill Gates' , Subject: 'Information Tech'},
                   {Id: 6, Name: 'Papa Johns' , Subject: 'Dance'}
]


})

;

//Here is my View - filtering my array


&lt;div ng-controller = "Ctrl"&gt;

&lt;table&gt;

&lt;tr&gt;
&lt;th&gt; Name &lt;/th&gt;
&lt;th&gt; Subject&lt;/th&gt;

&lt;/tr&gt;

&lt;tr ng-repeat=" t in Teachers"&gt;

&lt;td&gt;{{t.Name}}&lt;/td&gt;
&lt;td&gt;{{t.Subject}}&lt;/td&gt;
&lt;/tr&gt;

&lt;/div&gt;
</code></pre>

<p></p>

<p>The above context in working fine but i need to filter the results by the logged in user name. So for example below the table i want to have two check boxes to filter the data like so:</p>

<pre><code>&lt;input type="checkbox" ng=model="filter table by LoggedInTeacher "&gt; Show only Mine
&lt;input type="checkbox" ng-model="show all"&gt; Show All
</code></pre>

<p>How would I go about in achieving this ?</p>

<p>Thank you                                              </p>