multiple scopes, one jump list, using panels
Created
February 21, 2015 20:35
-
-
Save jodytate/8fe0f8cd35ce0e0a1147 to your computer and use it in GitHub Desktop.
muppet filter test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div ng-app="muppetApp" class="container" ng-controller="muppetController"> | |
| <h1>Muppet Filter Test</h1> | |
| <ul class="list-unstyled list-inline"> | |
| <li>First set of muppets ({{muppetsResults.length}})</li> | |
| <li>Second set of muppets ({{moreMuppetsResults.length}})</li> | |
| </ul> | |
| <form class="form-group"> | |
| <label>Filter your muppets</label> | |
| <input type="text" class="form-control" ng-model="query"> | |
| </form> | |
| <h2>Some Muppets</h2> | |
| <div proposal-panel ng-repeat="item in muppets|filter:query as muppetsResults"></div> | |
| <h2>Some More Muppets</h2> | |
| <div proposal-panel ng-repeat="item in moreMuppets|filter:query as moreMuppetsResults"></div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('muppetApp', []) | |
| .controller('muppetController',['$scope', function($scope) { | |
| $scope.muppets = [{ | |
| name: 'Kermit' | |
| }, { | |
| name: 'Fozzie' | |
| }]; | |
| $scope.moreMuppets = [{ | |
| name: 'Ms. Piggie' | |
| }, { | |
| name: 'Gonzo', | |
| }, { | |
| name: 'Crazy Harry' | |
| }]; | |
| }]) | |
| .directive('proposalPanel', function (){ | |
| return { | |
| template: '<div class="panel panel-default">'+ | |
| '<div class="panel-body">{{item.name}}</div>'+ | |
| /* '<div class="panel-footer"><p><small>Muppet</small></p></div>' +*/ | |
| '</div>' | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment