I need to find the ideal architectural solution.
Below is the HTML code I currently have:
<body ng-controller="individualFootprintController as $ctrl">
<div ng-hide="$ctrl.authenticated">
<h1>Login</h1>
With Corporate Account: <a href="/login/corporate">click here</a>
</div>
And this is the controller:
function individualFootprintController($http) {
var self = this;
$http.get("/is_auth").success(function () {
self.authenticated = true;
})
.error(function() {
self.authenticated = false;
}
);
}
Inquiries:
1) Should this logic be in the controller?
2) How can I get the actual "is_authenticated" value while only making the request once?