Thanks for that. I appreciate it. Two quick followups:
1. What is the semantics (and name) of using the ? (e.g as in ds?.data()
or ds?.output) in the example
2. How do you access a specific child. (e.g. how do I get at ds2 as in
below)
<data-service id="ds1">1,2,3</data-service>
<data-service id="ds2">4,5,6</data-service>
<span>Hello, there
<span [textContent]="name"></span>
<button (click)="ds?.data()">hit me {{ds?.output}}</button>
</span>
On Saturday, July 2, 2016 at 1:14:02 AM UTC-5, Sander Elias wrote:
>
> Hi Mike,
>
> I want to elaborate my last couple of msgs. Just to make sure I don't pass
> my own confusion along.
> There are a couple of ways to get to the children inside of a component.
> Fetching both components, but also any plain elements is possible. You can
> look up the exact details of this in the docs.
> However, when to use viewChildren and when to use contentChildren?
> The view is the template you provided to the template(url)
> The content is the user-provided content. (if you are familiar with NG1
> transcluded content)
> that means if you components uses ng-content the stuff that comes inside
> the ng-content(s) is available as contentChild(ren)
>
> 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.