|
0
|
1 |
(function(){ |
|
97
|
2 |
'use strict'; |
|
0
|
3 |
|
|
|
4 |
|
|
97
|
5 |
angular.module('ammicoHome',['ngRoute']) |
|
|
6 |
.config(function ($routeProvider) { |
|
|
7 |
$routeProvider |
|
|
8 |
.when('/', { |
|
|
9 |
templateUrl: 'home/home.html', |
|
|
10 |
controller: 'homeCtrl' |
|
|
11 |
}); |
|
|
12 |
}) |
|
|
13 |
.controller('homeCtrl', function($scope, $location){ |
|
|
14 |
$scope.searchSubmit = function(){ |
|
|
15 |
$location.path('/search/' + $scope.q); |
|
|
16 |
}; |
|
|
17 |
}) |
|
|
18 |
.filter('meta', function() { |
|
|
19 |
return function(input, metaName) { |
|
|
20 |
var nb = input.length, i = 0, found = false; |
|
|
21 |
while(found===false && i<nb){ |
|
|
22 |
if(input[i].name===metaName){ |
|
|
23 |
found = true; |
|
|
24 |
return input[i].value; |
|
|
25 |
} |
|
|
26 |
i++; |
|
|
27 |
} |
|
|
28 |
return ''; |
|
|
29 |
}; |
|
|
30 |
}); |
|
0
|
31 |
|
|
|
32 |
})(); |