-
Notifications
You must be signed in to change notification settings - Fork 872
docs(structural-components): add chapter #544
base: master
Are you sure you want to change the base?
Conversation
Noticed that @robertmesserle put a very nice and succinct version on the A2.io home page! Source is here. We should steal it. |
It does look steal worthy! I'll work on this some more soon, and get back to you with a finished chapter. |
In a conversation with @teropa it just dawned on me that I haven't covered the simple default case of I need to add a section about that. |
I agree with the direction. Carry on! |
89e849a
to
ad247d2
Compare
@wardbell I've updated the current content and examples to beta.2, added intro, table of contents and other minor edits. This PR at the moment does not include all the additions previously discussed, but it is functional and complete as is. We can come back to it later and add more content. |
ad247d2
to
f0e2e94
Compare
f0e2e94
to
694c6c4
Compare
@wardbell I've rolled this chapter into structural directives, as we discussed. |
of them. | ||
|
||
Lists given by `@ContentChildren` and `@ViewChildren` are of the `QueryList` | ||
type, and guaranteed to always the current, up to date components. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... to always contain? the current ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good eye, thanks!
694c6c4
to
b9da918
Compare
@wardbell @filipesilva - still actual? |
We will revisit this kind of PRs soon. |
Copied from ideablade pr 10
Ward says: WORK-IN-PROGRESS! Do not merge
The second half of Filipe's original "Structural Directives" chapter is here.
IMO (and Filipe and Pascal's apparently), that half seemed to depart from the point of Structural Directives and, in fact, defined a new kind of component that did the job of incorporating external content by projection.
This seemed to me to be a new concept, deserving its own chapter. For lack of better terms, I dubbed it the "Structural Component".
So, Filipe, this is something on my plate for review in the not-to-distant future. You may want to take it a next step before I get there. My sense is that a Tab/Tab Pane example fits perfectly in this chapter. Do you agree?
Filipe says: I was trying to move away from tabs because that was Victors example for
ng-content
(which isn't a strong reason).But to show
DynamicComponentLoader
, I think something simpler would be in order since tabs/tab-pane would require a bit more complexity in structure organization.For instance, the recall button component class could be provided by the parent component, and the dashboard would instantiated it. It would demonstrate that a component class could be referenced and used outside of templates, which is an amazing thing conceptually.
Ward replies: I know Victor did Tabs. But that's on his blog. If that seems the most obvious example of the need to project developer content into a component's template, I'm sure he would not mind.
I would prefer NOT to lead with
DynamicComponentLoader
. It's cool but not mainstream. Mainstream is the stuff with content children. That said, I'd love to see what you do with it.