header-menu.js

angular.module('homepage').
directive('headerMenu', function() {
    return {
        restrict: 'E',
        replace: true,
        transclude: true,
        templateUrl: 'components/content-components/header/header-menu.html',
        controller: 'loginController'
    }
}).
controller('loginController', function($scope, $window, Authentication, Server) {
    $scope.login = function() {
        Server.fblogin().
        success(function(data) {
            console.log(data);
        });
    };
    $scope.logout = function() {
        Server.logout().
        success(function(data) {
            Authentication.removeUser();
            $window.location.href = '/#/';
        });
    };
});