Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Comments for query.dart #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/directive_injector/query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ library angular.directive_injector.query;
* A [Query] needs to be further scoped as [@self], [@children], or [@descendents].
*
* Example:
*
* @Component(
* selector: 'tabs',
* template: '<ul><li [ng-repeat|pane]="panes">${pane.title}</li></ul>'
* )
* class Tabs {
* // COMMENT(deboer): This should also (or only) support Elements, not components. Otherwise
* // we will have a hard time supporting Web Components.
* @children Query<Pane> panes;
*
* Tabs(this.panes) {}
Expand All @@ -34,5 +35,6 @@ library angular.directive_injector.query;
*
* DESIGN: https://docs.google.com/document/d/1d-yxmxMVqZHHadvxQaC2CCvcAR17JUQ1Qs4RT6Rwp6Y
*/
// COMMENT(deboer): This should by a List isn't of an UnmodifieableListView since the set of elements can change over the course of the Query's life time.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think unmodifiable is the right API for clients. While internally (in the DirectiveInjector) it is modifiable, we don't want the clients to muck with it.

I would argue that providing DOM-consistent indexing might be too hard on first iteration (given ng-if, ng-repeat might wildly rearrange the Dom elements), and would just give one method forEach.

class Query<T> extends UnmodifiableListView<T> {
}
}