navmenu.js 776 B

12345678910111213141516171819202122232425262728293031
  1. app.directive('navMenu',['$interval',function($interval){
  2. return {
  3. restrict: 'E',
  4. scope: {
  5. toggleMenu: '&',
  6. isActive: '&'
  7. },
  8. templateUrl: 'app/views/nav-menu.html',
  9. controller: function($scope,$location){
  10. $scope.isActive = function(linkPath){
  11. if(linkPath == $location.path()){
  12. return true;
  13. } else{
  14. return false;
  15. }
  16. }
  17. $interval(function(){
  18. if(firebase.auth().currentUser){
  19. if(firebase.auth().currentUser.uid == 'uRkqD9GmNxUsdgF1XtmPicDJwAz1'){
  20. $scope.isModeratorSigned = true;
  21. } else{
  22. $scope.isModeratorSigned = false;
  23. }
  24. } else{
  25. $scope.isModeratorSigned = false;
  26. }
  27. },1000)
  28. }
  29. }
  30. }])