<div class="container-fluid" ng-app="phonecatApp"> <div class="row" ng-controller="PhoneListCtrl"> <div class="col-md-2"> Search: <input ng-model="query"> </div> <div class="col-md-10"> <ul class="phones"> <li ng-repeat="phone in phones | filter:query"> {{phone.name}} <p>{{phone.snippet}}</p> </li> </ul> </div> </div> </div>
var phonecatApp = angular.module('phonecatApp', []); phonecatApp.controller('PhoneListCtrl', function ($scope) { $scope.phones = [ {'name': 'Nexus S', 'snippet': 'Fast just got faster with Nexus S.'}, {'name': 'Motorola XOOMâ„¢ with Wi-Fi', 'snippet': 'The Next, Next Generation tablet.'}, {'name': 'MOTOROLA XOOMâ„¢', 'snippet': 'The Next, Next Generation tablet.'} ]; });