checkbox.js

angular.module('homepage').
directive('checkbox', function () {
    return {
        controller: 'checkboxController',
        restrict: 'E',
        replace: true,
        scope: {
            label: '=',
            name: '=',
            isChecked: '=',
            markCheckboxFn: '&'
        },
        transclude: true,
        templateUrl: 'components/common-components/checkbox/checkbox.html'
    }
}).
controller('checkboxController', function ($scope) {
    // Setting default value for the checkbox
    $scope.checked = $scope.checked ? $scope.checked : false;
});