Jump to content

I have the following block of code to control access to different pages based on the user logged in(and their role), and to check if they're logged in. The both checkAllowed and isLoggedIn will return either true/false based on the path the user is navigating to and their role in the application (admin, user, etc).

http://pastebin.com/ZVV8iz3c

But i would like the two POSTs to get a response before the actual view is loaded. I am not sure how to accomplish this, i started playing around a bit with .then and $q, but i am still pretty new to angular. Is there a better way to manage access control that will run before anything else loads?

CPU: i7 3770k @ 4.8Ghz Motherboard: Sabertooth Z77 RAM: 16GB Corsair Vengeance GPU: GTX 780 Case: Corsair 540 Air Storage: 2x Intel 520 SSD Raid 0 PSU: Corsair AX850 Display(s): 1x 27" Samsung Monitor 3x 24" Asus Monitors Cooling: Swifttech H220 Keyboard: Logitech 710+ Mouse: Logitech G500 Headphones: Sennheiser HD 558 --- Internet: http://linustechtips.com/main/uploads/gallery/album_1107/gallery_12431_1107_23677.png My Setup:  http://linustechtips.com/main/gallery/image/7922-1-rkcf7io/ -- NAS: 3x WD Red 3TB Drives (RAIDZ-1), 5x 750gb Seagate ES HDD(RAIDZ-1), 120gb SSD for caching, OS: FreeNAS --  Server 1: Xeon E3 1275v2, 32GB of RAM, OS: ESXi 5.5 -- Server 2: Xeon E3 1220v2, 32GB of RAM, OS: ESXi 5.5

 

Link to comment
https://linustechtips.com/topic/313753-angularjs-help/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×