It there a similar syntax to the controller "as" syntax to pull data from
the component?
<tags-analytics analytics-data='tags.names' ng-component="TagsAnalytics as
tagsAnalytics">
<tags-detail-list list-data="tagAnalytics.mostPopular"
></tags-detail-list>
<tags-analytics analytics-data="tagsAnalytics.mostRecent"
ng-component="TagsAnalytics
as recentTagsAnalytics">
<tags-detail-list list-data="recentTagAnalytics.names"
></tags-detail-list>
</tags-analytics>
</tag-analytics>
Is there anyway to decouple and use two different views with the same
component?
<tags graph-data='tags.names'>
<crazy-pie-library pie-data="tags.graphData">...</div>
</tags>
<tags graph-data='tags.names'>
<crazy-bars-library bar-data="tags.graphData">...</div>
</tags>
On Wednesday, February 10, 2016 at 12:38:56 AM UTC-8, Sander Elias wrote:
>
> Hi Mike,
>
> You should move away from controllers and towards components
> <https://docs.angularjs.org/guide/component>. Doing that alone, will
> solve a couple of issues you have right away. Then for the binding of
> tags.names. I assume that's an array. Instead of using an init function,
> you can use the $attrs.observe from the aforementioned components. By doing
> that you will end up with something that can look like this:
>
> <tags graph-data='tags.names'>
> <div ng-repeat='name in tags.graphData'>...</div>
> </tags>
>
> Does this help a tad, or did I confuse you even more? ;) If so, just ask.
>
> Regards
> Sander
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.