3
votes

I am porting to AngularDart an app in which a user's UI contains three panels:

  1. Question panel in which s/he can answer.
  2. A (readonly) panel in which his/her can see a partner answering the same questions.
  3. A common panel where both the user and his/her partner can collaborate on various activities.

Based on the answer to this [1] question, it seems that a "logical page" (rendered from, say, a file abc.html) can contain multiple views. Is this situation of have three panels a good use case for Angular views? If so

Question: how can can I define a page with three views in AngularDart? And what are the standard view update mechanisms (i.e., code examples of how those views would be updated)?

I have not found any examples of the use of multiple views and/or how to populate them through, say, a view() RouteEventHandler (or not). All I have found is what is given below.


The AngularDart tutorial gives an example, in Chapter 6, of index.html containing a single view

  <section id="details">
    <ng-view></ng-view>
  </section>

that is populated, in part, through the routing configuration, e.g.:

router.root
  ..addRoute(
      name: 'add',
      path: '/add',
      enter: view('view/addRecipe.html'))

[1] AngularDart: "logical pages" and views are 1-to-1 or 1-to-many or what?

2

2 Answers

0
votes

This AngularDart sample app seems to have multiple views

vsavkin / angulardart-sample-app

0
votes

After some digging I have found that it is not currently possible, either in AngularDart or AngularJS (e.g., see this post).

In fact, such a feature was proposed in AngularJs and eventually rejected as can be seen by the discussion associated with Angular.js Pull Request #1198.

Recommended alternatives include:

  • Use of ng-include.
  • For Angular.js, use of the Angular-ui/ui-router which has support for multiple named views.
  • For AngularDart, there is this port: angular.dart.ui, but I do not know how feature complete it is.