In the jsbin demo provided, there is an input field, a select option, and a list of movies. The objective is to filter the list of movies in Angular based on user input in the input field and selection in the select dropdown.
<div ng-controller="myController">
<input type="text" ng-model="search"/>
<select>
<option ng-repeat="item in dropdown" value="{{item}}">{{item}}</option>
</select>
<br/>
<ul>
<li ng-repeat="movie in movies">
Name: <strong>{{movie.name}}</strong> |
director: <strong>{{movie.director}}</strong> |
actor: <strong>{{movie.actor}}</strong>
</li>
</ul>
The controller function is defined as follows:
var myApp = angular.module('myApp',[]);
myApp.controller('myController',function myController($scope){
$scope.dropdown = ['name','director','actor'];
$scope.movies = [
{name:'test',director:'test di',actor:'test ac'},
{name:'test2',director:'test2 di',actor:'test2 ac'},
{name:'test3',director:'test3 di',actor:'test3 ac'},
{name:'test4',director:'test4 di',actor:'test4 ac'}
];
});