'use strict';
angular.module('ocreApp')
- .controller('NavbarCtrl', function ($scope, $location, Auth) {
- $scope.menu = [{
- 'title': 'Accueil',
- 'link': '/'
- }];
+.controller('NavbarCtrl', function ($scope, $rootScope, $location, Auth) {
+ $scope.menu = [
+ {
+ 'title': 'Découvrir les projets',
+ 'link': '/projects'
+ },
+ {
+ 'title': 'Proposez votre projet',
+ 'link': '/project_create'
+ }
+ ];
$scope.isCollapsed = true;
$scope.isLoggedIn = Auth.isLoggedIn;
$scope.getCurrentUser = Auth.getCurrentUser;
$scope.logout = function() {
- Auth.logout();
- $location.path('/login');
+ Auth.logout();
+ $location.path('/login');
};
$scope.isActive = function(route) {
- return route === $location.path();
+ return route === $location.path();
};
- });
\ No newline at end of file
+
+ /**
+ *
+ * @function goto
+ * @parameters String route, String profileId
+ * @description Going to route and adding profileId to rootScope
+ *
+ **/
+ $scope.goto = function(route, profileId) {
+ $rootScope.profile_id = profileId;
+ $location.path(route);
+
+ }
+
+
+});
\ No newline at end of file