javascript - Angularjs Partial View vs Directive -


our spa has 2 distinctive top level views. compare windows file explorer showing tree view on 1 side , content details on other side. these top level views, considering have 2 partial views. other alternative pack these views directives. our initial thoughts going toward partial views, because these quite larger blocks of functionalties , each view can have multiple controllers. experience/thoughts on similar lines decide. note communicate between these views using eventing mechanism.

we not intend reuses these views. specifically, there issues going partial views? performance, maintainability, etc.

i'm not sure i'm understanding problem here, sorry if wrong (also sorry english). need 2 views; if 'inside' views use directive or not, it's thing. thing i'm pretty sure 2 views need have they're own scope.

to me seems lot 'navigation menu' vs. 'view' kind of problem (only navigation part gonna sort of tree-view), solution should similar:

  • the 'normal' ngview (your 'details' side);
  • a div it's own controller (and it's own scope).

something like:

<nav ng-controller="treeviewcontroller()">     <!-- here use directive, example -->     <tree-view ng-model="tree"></tree-view> </nav> <div ng-view></div> 

then best way make them communicate custom service.

in case misunderstood problem, sorry in advance.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -