Good day. I created rest api with node.js and strongloop. Also there is app based on angular.js. When user login, server send accessToken and it store in cookies. Every request i send accessToken, and it checks. So, what is the better way to add some content to Single page app after user login and hide when logout. Also i created form in angular modal dialog.
If you need to disable some views, accessible by link, like profile view, you could use ui router
, create login state and state(s), that can be shown only for logged user using resolve
option. Please review this example, loginRequired
function usage. You are not required to use satellizer
(but you could, this lib is really awesome).
If you need to just hide some partial or html snippet, like a "logout" button you can use ng-if="isAuthenticated()"
.
Hope it helped.