sidebar-card.js

angular.module('homepage').
directive('sidebarCard', function () {
    return {
        controller: 'sidebarCardController',
        restrict: 'E',
        replace: true,
        scope: {
        	data: '='
        },
        transclude: true,
        templateUrl: 'components/content-components/sidebar/sidebar-card.html'
    };
}).
controller('sidebarCardController', function ($scope, Server) {
    $scope.markCheckbox = function (hashid, isChecked) {
        var data = {
            'hashid': hashid,
            'isChecked': isChecked
        };
        
        Server.markTemplate(data)
        .success(function (result) {
            console.log(result);
        });
    };
});