habit-card-detail.js

angular.module('homepage').
directive('habitCardDetail', function () {
	function HabitCardLinkerFn(scope, element, attributes) {

    }

    return {
		controller: 'HabitCardController',
		//link: HabitCardLinkerFn,
		restrict: 'E',
		replace: true,
		scope: {
			item: '='
		},
		transclude: true,
		templateUrl: 'components/feature-components/habit/habit-card-detail.html'
	};
}).
controller('HabitCardController', function ($scope, MobileType, Server) {
	$scope.isMobile = MobileType.any();
	$scope.markCheckbox = function (hashid, isChecked) {
        var data = {
            'hashid': hashid,
            'isChecked': isChecked
        };

        Server.markTemplate(data)
        .success(function (result) {
            console.log(result);
        });
    };
});