angularjs - General approach of left side menu that loads different content in a center of the page -


i've started learn angualrjs but... need application design hints. of course i'm not asking layout ... how design application , it's controllers in proper way. have left sidebar menu loaded web using json. needs controller. that's fine. works me. there's content box in center of page loads data dynamically. in opinion requires controller.

and comes solution, somehow doesn't imho. when click menu item in sidebar i'm loading content. i'm passing data service emits event afterwards second controller (which ressponsible controlling content in center of page). when receives event gets loaded data service , displays it. works.... ... i'm pretty sure that's not proper way of doing this.

i grateful hints. angular has poor documentation , tutorial :(

cheers

edit:

ok. that's basic application using jquery:

http://greatanubis-motoscore.rhcloud.com/index

and that's same application i'm converting angualr:

http://greatanubis-motoscore.rhcloud.com/angular/index

no worries, text in polish but... think doesn't matter ;)

note angular version: @ moment content html load json data other controllers.

i go doing angular ui-router. ui-router can achieve in couple of ways. can use nested routing have base state (your sidebar menu, header etc.) act shell page, can have own controller well. define each of other views child states of base state. these child states can have own controller/views well, sitting inside base state (both visually, , inherit $scope properties of base state) optionally can have separated urls themselves, don't have to, can change states without changing url, leaving url bit empty when define different states in $stateprovider configs. way use multiple named views feature.


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 -

jquery - Keeping Kendo Datepicker in min/max range -