Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs(structural-components): add chapter #544

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wardbell
Copy link
Contributor

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.

@wardbell
Copy link
Contributor Author

Noticed that @robertmesserle put a very nice and succinct version on the A2.io home page! Source is here. We should steal it.

@wardbell wardbell closed this Dec 15, 2015
@wardbell wardbell reopened this Dec 15, 2015
@filipesilva
Copy link
Contributor

It does look steal worthy!

I'll work on this some more soon, and get back to you with a finished chapter.

@filipesilva
Copy link
Contributor

In a conversation with @teropa it just dawned on me that I haven't covered the simple default case of <ng-content> with no selector, which just transcludes everything in the components light dom.

I need to add a section about that.

@wardbell
Copy link
Contributor Author

I agree with the direction. Carry on!

@filipesilva filipesilva force-pushed the devguide-structural-components branch from 89e849a to ad247d2 Compare February 3, 2016 21:16
@filipesilva
Copy link
Contributor

@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.

@filipesilva filipesilva force-pushed the devguide-structural-components branch from ad247d2 to f0e2e94 Compare February 3, 2016 21:23
@filipesilva filipesilva force-pushed the devguide-structural-components branch from f0e2e94 to 694c6c4 Compare March 10, 2016 18:39
@filipesilva
Copy link
Contributor

@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.
Copy link

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 ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Good eye, thanks!

@filipesilva filipesilva force-pushed the devguide-structural-components branch from 694c6c4 to b9da918 Compare March 11, 2016 15:18
@Foxandxss Foxandxss changed the title [WIP] docs(structural-components): add chapter docs(structural-components): add chapter Jun 9, 2016
@ghost
Copy link

ghost commented Apr 7, 2017

@wardbell @filipesilva - still actual?

@Foxandxss
Copy link
Member

We will revisit this kind of PRs soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants