File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /* global angular */
2+ angular . module ( 'codexen' )
3+ . controller ( 'AppController' , function ( $scope ) {
4+
5+ } )
Original file line number Diff line number Diff line change 1+ /* global angular */
2+ angular . module ( 'codexen' )
3+ . filter ( 'searchSnippets' , function ( $filter ) {
4+ return function ( input , needle ) {
5+ if ( ! angular . isString ( needle ) ) return input
6+ if ( needle . match ( / ^ # ./ ) ) {
7+ var name = needle . match ( / ^ # ( .+ ) / ) [ 1 ]
8+ return input . filter ( function ( snippet ) {
9+ return snippet . Tags . some ( function ( tag ) {
10+ return tag . name . match ( new RegExp ( name ) )
11+ } )
12+ } )
13+ }
14+ else return $filter ( 'filter' ) ( input , needle )
15+ }
16+ } )
Original file line number Diff line number Diff line change 1818
1919
2020 </ head >
21- < body >
21+ < body ng-controller =" AppController as app " >
2222 < div side-nav id ="side-view "> </ div >
2323 < div ui-view name ="main-view " id ="main-view "> </ div >
2424
Original file line number Diff line number Diff line change 2626 < a ui-sref ="auth.signin " class ="btn btn-default "> < i class ="fa fa-signin "> </ i > Sign In</ a >
2727 </ li >
2828
29- < li ng-repeat ="snippet in vm.snippets | filter :vm.search " ui-sref ="snippets.detail({id:snippet.id}) " ui-sref-active ="active ">
29+ < li ng-repeat ="snippet in vm.snippets | searchSnippets :vm.search " ui-sref ="snippets.detail({id:snippet.id}) " ui-sref-active ="active ">
3030 < div class ="media ">
3131 < div class ="media-left ">
3232 < img width ="25 " height ="25 " class ="img-circle " src ="http://www.gravatar.com/avatar/ea0b6ad1c11700120d1af08810caa19d " alt ="" />
You can’t perform that action at this time.
0 commit comments