Note that there are some explanatory texts on larger screens.

plurals
  1. POWith angular.js using ui-router, how to only reload one view?
    primarykey
    data
    text
    <p>I have a fairly simple todo app using angular.js for which I am using the ui-router library. I looked through the ui-router example on github (<a href="https://github.com/angular-ui/ui-router/tree/master/sample" rel="nofollow">https://github.com/angular-ui/ui-router/tree/master/sample</a>) but was unable to figure out what I am doing wrong. In my app I have a sidebar navigation view (with the list of things todo) and a content view (which displays the todo item's details when clicked). The problem I have is that when I navigate to /todo/exampleItem the content view updates and the navigation panel is reloaded as well. This doesn't effect the functionality of the app but I would like to avoid the navigation panel flickering each time you click on an item. </p> <p>Here is my code to handle the state changes: </p> <pre><code>app.config(function ($stateProvider) { $stateProvider .state('todo', { url: "/todo", views: { "navPanel": { templateUrl: "./navPanel.html", controller: 'PanelController' } } }) .state('todo/:item', { url: "/todo/:item", views: { "PanelView": { templateUrl: "./navPanel.html", controller: 'PanelController' }, "ContentView": { templateUrl: "./content.html", controller: 'ContentController' } } }) }); </code></pre> <p>In my index.html my views are set up as follows:</p> <pre><code> &lt;div class="column" data-ui-view="PanelView"&gt;&lt;/div&gt; &lt;div class="column" data-ui-view="ContentView"&gt;&lt;/div&gt; </code></pre> <p>Is there some way I can stop the navPanel view from being reloaded each time a new item is clicked?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload