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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
(function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
  'use strict';
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
  angular.module('ammicoHome',['ngRoute'])
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
    .config(function ($routeProvider) {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
      $routeProvider
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
        .when('/', {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
          templateUrl: 'home/home.html',
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
          controller: 'homeCtrl'
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
        });
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
    })
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
    .controller('homeCtrl', function($scope, $location){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
      console.log('5-0',$scope, $location);
1
74bbdd739878 views, path, search...
cavaliet
parents: 0
diff changeset
    15
      $scope.searchSubmit = function(){
74bbdd739878 views, path, search...
cavaliet
parents: 0
diff changeset
    16
          $location.path('/search/' + $scope.q);
74bbdd739878 views, path, search...
cavaliet
parents: 0
diff changeset
    17
      };
8
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    18
    })
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    19
    .filter('meta', function() {
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    20
        return function(input, metaName) {
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    21
            var nb = input.length, i = 0, found = false;
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    22
            while(found===false && i<nb){
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    23
                if(input[i].name===metaName){
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    24
                    found = true;
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    25
                    return input[i].value;
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    26
                }
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    27
                i++;
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    28
            }
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    29
            return '';
824c87a9084c (really) better management of slideshowModel with new api.
cavaliet
parents: 1
diff changeset
    30
        };
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
    });
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
})();