Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>But I see several things that you may have incorrect.</p> <ul> <li><p>You're using <code>ui.compat</code> module. Use <code>ui.state</code> instead. compat is for backwards compatibility if you have an existing project using <code>ng-view</code> and <code>routeProvider</code>.</p></li> <li><p>I would nest the details view <em>inside</em> the file list view. That helps because now when you switch between files, only the details view updates, not the list as well. I added a log to prove it. See my plunkr below. Navigate from the folder to the file and back several times. The "list" controller only instantiates once. </p></li> <li><p>I also merged your detail state into a single state with a url of <code>url: "/:type/:id"</code>, so it captures both /folder/id and /file/id </p></li> </ul> <p>Here's a plunkr I made for you: <a href="http://plnkr.co/edit/6BEIs6?p=preview" rel="nofollow">http://plnkr.co/edit/6BEIs6?p=preview</a></p> <hr/> <p>Also you said:</p> <blockquote> <p>When the user double-clicks a folder the view should refresh and list the subfolder while the detail column should be cleared.</p> </blockquote> <p>So I also made a version that can root down into folders (double click them), just like a real file explorer, and you can go back up too (single click the ../). </p> <p><a href="http://plnkr.co/edit/tAjv2I?p=preview" rel="nofollow">http://plnkr.co/edit/tAjv2I?p=preview</a></p> <p>I think its pretty good, though if I had more time it'd be nice if the url also stored your location in the folders (as opposed to just what type of file to show in the details).</p> <hr/> <p>EDIT: So I wanted to try and figure out how to make the folder path sync to the location path. Well I figured it out, but it requires doing quite a bit manually. For example I only have 1 state, with a url of "*path", which just captures the entire path even '/' characters. Then I have to parse it and make it do what I need it to. See the plunkr:</p> <p><a href="http://plnkr.co/edit/1dDN3x?p=preview" rel="nofollow">http://plnkr.co/edit/1dDN3x?p=preview</a></p>
 

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