Skip to content

Instantly share code, notes, and snippets.

@GeertVL-zz
Last active August 29, 2015 13:56
Show Gist options
  • Save GeertVL-zz/8828088 to your computer and use it in GitHub Desktop.
Save GeertVL-zz/8828088 to your computer and use it in GitHub Desktop.
'use strict';
/* Filters */
angular.module('myApp.filters', []).
filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
};
}]).
filter('bygenre', function () {
return function (fileList, genres) {
var selectedItems = [];
angular.forEach(fileList, function (value) {
if (genres[value.type] === true) {
this.push(value);
}
}, selectedItems);
return selectedItems;
};
});
.controller('filesPortfolioCtrl', ['$scope', function($scope) {
$scope.genrefilters = {
image: true,
brochure: true,
presentation: true,
video: true,
logo: true
};
$scope.filesPortfolio = {
id:0,
idName:"Documents",
number:"1",
name:"Documents",
files:[
{id:0,type:"image",title:"Brochure Cooling", image:"thumb0.png"},
{id:1,type:"image",title:"Cooling systems", image:"thumb1.jpg"},
{id:2,type:"image",title:"Transport systems", image:"thumb2.jpg"},
{id:3,type:"video",title:"Long distance transport", image:"thumb3.jpg"},
{id:4,type:"image",title:"Short distance transport", image:"thumb4.jpg"},
{id:5,type:"image",title:"Cooling trucks", image:"thumb5.jpg"},
{id:6,type:"logo",title:"Temperature control", image:"thumb6.tiff"},
{id:7,type:"logo",title:"Control tools", image:"thumb7.tiff"},
{id:8,type:"brochure",title:"Transport tools", image:"thumb8.jpg"},
{id:9,type:"image",title:"Testing", image:"thumb9.jpg"},
{id:10,type:"image",title:"Transport mileage", image:"thumb10.jpg"},
{id:11,type:"logo",title:"Maintenance cooling", image:"thumb16.tiff"},
{id:12,type:"presentation",title:"Maintenance Transport", image:"thumb12.jpg"},
{id:13,type:"presentation",title:"Maintenance Truck", image:"thumb13.jpg"},
{id:14,type:"image",title:"Cooling devices", image:"thumb14.jpg"},
{id:15,type:"image",title:"Cool stuff", image:"thumb15.jpg"},
]
};
}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment