commonroutesAdminWeb/views/navbar.js
views/navbar.jsRaw
1'use strict';
2
3angular.module('app.navbar', ['ngRoute'])
4
5 .config(['$routeProvider', function($routeProvider) {
6 $routeProvider.when('/navbar', {
7 templateUrl: 'views/navbar/navbar.html',
8 controller: 'NavbarCtrl'
9 });
10 }])
11
12 .controller('NavbarCtrl', function($scope, $http, $routeParams, $location) {
13 $scope.searchString = "";
14 $scope.locationHash = $location.path();
15 console.log($scope.locationHash);
16 $scope.goBack = function() {
17 console.log("goBack");
18 window.history.back();
19 };
20
21 $scope.search = function() {
22 console.log($scope.searchString);
23 window.location.href = "#!/search/" + $scope.searchString;
24 };
25 $scope.logout = function() {
26 localStorage.removeItem("cic_admin_token");
27 localStorage.removeItem("cic_admin_userdata");
28 window.location.reload();
29 };
30 });