activity-list.js

angular.module('homepage').
directive('activityList', function() {
    return {
        restrict: 'E',
        replace: true,
        scope: {
            activities: '=data'
        },
        templateUrl: 'components/content-components/input/activity-list.html',
        controller: 'activityListController'
    };
}).
controller('activityListController', function($scope, Activity) {
    if(!$scope.activities || $scope.activities.length === 0) {
        $scope.activities = [];
        $scope.activities[0] = new Activity();
    }

    $scope.addActivity = function () {
        var length = $scope.activities.length;
        $scope.activities[length] = new Activity();
    };
});