(function(){
var app = angular.module('bars',[]);
app.controller('BarController',function(){
this.bars = bars;
});
app.controller('YearController',function(){
this.theyear = 0;
this.years = years;
this.setYear = function(year){
this.theyear = parseInt(year);
};
this.isSelected = function(year){
return this.theyear === year;
};
});
var years = [
{
name: '2007',
id: 0,
headliner: 'Something has happened'
},
{
name: '2008',
id: 1,
headliner: 'Something else has happened'
}
];
var bars = [
{
name: 'Wilfred Jameson',
color: '#e23069',
picture: 'http://www.afcb.co.uk/images/common/bg_player_profile_default_big.png',
year: [
{
name:2007,
percentage: 100,
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam, maiores!'
},
{
name:2008,
percentage: 44,
description: 'Test'
}
]
},
{
name: 'Georgina Lange',
color: '#0088cc',
picture: 'http://eshmyo.karatekin.edu.tr/dosyalar/image/default_profile_female.png',
year: [
{
name:2007,
percentage: 72,
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse cupiditate iure sunt minima ea, eius?'
},
{
name:2008,
percentage: 62,
description: 'Test2'
}
]
},
{
name: 'Timothy Gerbil',
color: '#fe3021',
picture: 'http://twiki.org/p/pub/Main/UserProfileHeader/default-user-profile.jpg',
year: [
{
name:2007,
percentage: 83,
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse cupiditate iure sunt minima ea, eius?'
}
]
},
{
name: 'Lizz Abbadon',
color: '#6C0CE8',
picture: 'http://www.salsapartner.eu/images/anonymous_woman.jpg',
year: [
{
name:2007,
percentage: 36,
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse cupiditate iure sunt minima ea, eius?'
},
{
name:2008,
percentage: 40,
description: 'Test2'
}
]
}
];
})();
body {margin:0;}
*,*:before,*:after {
transition:all 0.3s;
-webkit-transition:all 0.3s;
box-sizing:border-box;
}
/* CSS Styles Here */
If you're trying to figure out why your filter is not working, don't worry, we've all been there! Debugging can be tough, especially with new technology like AngularJS. Hang in there and keep experimenting!
Feel free to test the example provided with some dummy data included. Happy coding!