Polymer.dart How to query for a scoped class
I have a parent component that serves as a container for other components.
I want the container to be able to query for elements inside it's
component. For example, my outer component is:
<polymer-element name="task-dart">
<template>
<div class="task-list">
<template repeat="{{tasks}}">
<task-row task="{{}}"></task-row>
</template>
</div>
</template>
<script type="application/dart" src="taskdart.dart"></script>
</polymer-element>
And my inner component is:
<polymer-element name="task-row" attributes="task">
<template>
<div class="task">
<!-- html components of the task -->
</div>
</template>
<script type="application/dart" src="task_row.dart"></script>
</polymer-element>
But the neither of the following in taskdart.dart produce any results:
void created() {
super.created();
print(queryAll(".task").toString()); // []
Timer.run( () {
print("queryAll: " + queryAll(".task").toString()); // []
});
}
Is this because the css is scoped in the internal component, or is because
there's nothing to query at this point during initialization? Either way,
how would I fix it?
No comments:
Post a Comment