asp.net mvc - ApplicationState data in angularjs -


in mvc application, store applicationstate data userdisplayname, roles etc in model. collected httpcontext.current or thread.current.

injected each controller, have access info on each different view.

but best practice share info in different angularjs views? should store vm in $rootscope, or html5 local storage, or else?

personally i'd use service retrieve/set data whenever needed, services more reasons though, can two-way data binding between controllers, easy injectable other controllers/services/factories, singletons , data there easy accessible until refresh page


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -