Skip to content

Instantly share code, notes, and snippets.

@mbuttler
Created August 5, 2015 19:07
Show Gist options
  • Save mbuttler/933732bb4c74058f45bd to your computer and use it in GitHub Desktop.
Save mbuttler/933732bb4c74058f45bd to your computer and use it in GitHub Desktop.
app.controller('MainController', ['$scope', function($scope) {
$scope.exercises = [
{
icon: 'img/pushup.jpg',
name: 'Pushups',
count: 20
},
{
icon: 'img/squat.jpg',
name: 'Squats',
count: 15
},
{
icon: 'img/pullup.jpg',
name: 'Pullups',
count: 10
},
{
icon: 'img/row.jpg',
name: 'Rows',
count: 10
},
{
icon: 'img/lunge.jpg',
name: 'Lunges',
count: 10
},
{
icon: 'img/stepup.jpg',
name: 'Step Ups',
count: 10
},
{
icon: 'img/situp.jpg',
name: 'Sit Ups',
count: 15
}
];
$scope.increase = function(index) {
$scope.excercises[index].count += 1;
};
$scope.decrease = function(index) {
$scope.excercises[index].count -= 1;
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment