angularjs - how to avoid state reload using angular -
have created app uses 2 separate areas display data. 1 on top of other (because seemed cool idea:) )
my problem both controlled states, , can not figure out how make underlying state not updated when top layer is. however, want underlying layer there.
this how have set states
.config(function ($stateprovider, $urlrouterprovider) { $urlrouterprovider.otherwise(''); //setting default padz $stateprovider .state('index', { url: '', views: { "musicview": { templateurl: 'partials/music', controller: 'musiccontroller' }, "controlview": { templateurl: 'controlview/welcome', controller: 'controllercv' } } }) .state('about', { url: 'about', views: { "musicview": { templateurl: 'partials/music', controller: 'musiccontroller' }, "controlview": { templateurl: 'controlview/welcome', cotroller: 'contrillercv' } } }) .state('config', { url: 'config', views: { "musicview": { templateurl: 'partials/music', controller: 'musiccontroller' }, "controlview": { templateurl: 'controlview/config', cotroller: 'controllercv' } } }) .state('contact', { url: 'contact', views: { "musicview": { templateurl: 'partials/music', controller: 'musiccontroller' }, "controlview": { templateurl: 'controlview/contact', cotroller: 'controllercv' } } }) .state('forum', { url: 'forum', views: { "musicview": { templateurl: 'partials/music', controller: 'musiccontroller' }, "controlview": { templateurl: 'controlview/forum', cotroller: 'controllercv' } } }) and ui-views
<div id="musiccontainer"> <div ui-view="musicview"></div> </div><!-- end of container--> <div id="controllayer"> <% include controlview/controls/defaults.ejs %> <div id="controlwindow"> <div ui-view="controlview"> </div> </div> <% include controlview/controls/playlog.ejs %> </div>
since both views have states switching smultaneously. maybe if want 1 of them present need remove in view list , have structure this:
<!-- 1 managed 1 controller : mystaticdatacontroller--> <div id="musiccontainer"> <div ng-controller="mystaticdatacontroller"> </div> </div> <!-- 1 changing accoriding states--> <div id="controllayer"> <% include controlview/controls/defaults.ejs %> <div id="controlwindow"> <div ui-view="controlview"> </div> </div> <% include controlview/controls/playlog.ejs %> </div>
Comments
Post a Comment