angular.module('agileApp').directive('agileNavbarNew', ['UserAuthService', '$modal', function(userAuthService, $modal) { return { scope: true, link: function($scope, element, attrs){ $scope.logout = function() { userAuthService.logout(); } $scope.getProfileImage = function() { return userAuthService.getProfileImage(); } $scope.help = function() { modalInstance = $modal.open({ animation: $scope.animationsEnabled, templateUrl: 'partials/modals/help-modal-partial.html', windowClass: 'agile-modal', size: "m" }); modalInstance.result.then(function(reason) { }); } console.log($scope); }, restrict: 'E', templateUrl: 'partials/navbar-new-partial.html' } }])