Skip to content

Instantly share code, notes, and snippets.

@pareshchouhan
Created October 9, 2014 06:12
Show Gist options
  • Select an option

  • Save pareshchouhan/162d03d18ef5beb3faf1 to your computer and use it in GitHub Desktop.

Select an option

Save pareshchouhan/162d03d18ef5beb3faf1 to your computer and use it in GitHub Desktop.
function NavBarController($scope,$routeParams) {
this.activeTab = 1;
this.loggedIn = false;
this.setLoggedInState = function(loginState) {
if(loginState == 1) {
this.loggedIn = true;
}
else {
this.loggedIn = false;
}
}
this.setActiveTab = function(tab) {
this.activeTab = tab;
}
this.checkLoggedIn = function() {
alert(this.loggedIn);
if(this.loggedIn == true) {
return true;
}
else {
return false;
}
}
this.isTabActive = function(tab) {
return (this.activeTab == tab)?true : false;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment