client/app/home/home_controller.js
author cavaliet
Mon, 06 Oct 2014 22:52:30 +0200
changeset 8 824c87a9084c
parent 1 74bbdd739878
child 14 4d27fbc3f9df
permissions -rw-r--r--
(really) better management of slideshowModel with new api.

(function(){
  'use strict';


  angular.module('ammicoHome',['ngRoute'])
    .config(function ($routeProvider) {
      $routeProvider
        .when('/', {
          templateUrl: 'home/home.html',
          controller: 'homeCtrl'
        });
    })
    .controller('homeCtrl', function($scope, $location){
      console.log('5-0',$scope, $location);
      $scope.searchSubmit = function(){
          $location.path('/search/' + $scope.q);
      };
    })
    .filter('meta', function() {
        return function(input, metaName) {
            var nb = input.length, i = 0, found = false;
            while(found===false && i<nb){
                if(input[i].name===metaName){
                    found = true;
                    return input[i].value;
                }
                i++;
            }
            return '';
        };
    });

})();