Skip to content

Commit a75b1d4

Browse files
committed
fix(client:navbar.controller): refactor EJS, exclude constructor if empty
1 parent a24643a commit a75b1d4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Diff for: templates/app/client/components/navbar/navbar.controller.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ class NavbarController {
99

1010
isCollapsed = true;
1111
//end-non-standard
12+
<%_ if(filters.ngroute || filters.auth) { _%>
1213

13-
constructor(<% if(!filters.uirouter) { %>$location<% } if(!filters.uirouter && filters.auth) { %>, <% } if (filters.auth) { %>Auth<% } %>) {<% if(!filters.uirouter) { %>
14-
this.$location = $location;<% } %>
15-
<% if (filters.auth) { %>this.isLoggedIn = Auth.isLoggedIn;
14+
constructor(<% if(!filters.uirouter) { %>$location<% } if(!filters.uirouter && filters.auth) { %>, <% } if (filters.auth) { %>Auth<% } %>) {
15+
<%_ if(!filters.uirouter) { _%>
16+
this.$location = $location;
17+
<%_ } _%>
18+
<%_ if (filters.auth) { _%>
19+
this.isLoggedIn = Auth.isLoggedIn;
1620
this.isAdmin = Auth.isAdmin;
1721
this.getCurrentUser = Auth.getCurrentUser;
18-
<% } %>}<% if(!filters.uirouter) { %>
22+
<%_ } _%>
23+
}<% } %>
24+
<%_ if(!filters.uirouter) { _%>
1925

2026
isActive(route) {
2127
return route === this.$location.path();

0 commit comments

Comments
 (0)