Repository: angular
Issue: [Feature] @ContentChildren() option to traverse just ng-container and ng-template
Labels: feature,area: core,core: queries,feature: insufficient votes,feature: votes required

## I'm submitting a...
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
</code></pre>

## Current behavior
`@ContentChild()` matches only direct descendants or all descendands with the `{descendants: true}` option


## Expected behavior
Another option which allow to query direct descendands together with **all and only** descendands inside ng-template or ng-container tags.
Or some kind of reference/option which, put on nested elements, would make them discoverable by `@ContentChildren` even if nested.
The second could be preferrable because the decision is left to who is writing the template and not to who wrote the component.

## What is the motivation / use case for changing the behavior?
See [issue](https://github.com/angular/material2/issues/12060) with `matPrefix` for mat-form-field in angular/material2.

In some cases being able to manually flag ng-container and ng-template as "traversable" could easily prevent the creation of a new component or the duplication of all common code which can be a lot.
In the provided use case, only the input element had to change while all other mat-form-field pieces are always the same: here's an abstract of the use case with more context that the stackblitz provided into the linked issue.

```html
<mat-form-field *ngFor="let fields of fields">
    <mat-label>{{ field.name }}</mat-label>

    <input *ngIf="field.status == 'disabled'; else switchConditions" matInput disabled>

    <ng-template #switchConditions>
        <ng-container [ngSwitch]="field.type">
            <ng-container *ngSwitchCase="'date'">
                <!-- matPrefix here won't work because @ContentChildren do not traverse ng-template and ng.container -->
                <mat-datepicker-toggle matPrefix [for]="datePicker"></mat-datepicker-toggle>
                <input matInput [(ngModel)]="field.value" [matDatepicker]="datePicker">
                <mat-datepicker #datePicker></mat-datepicker>
            </ng-container>

            <ng-container *ngSwitchCase="'select'">
                <mat-select [(ngModel)]="field.value">
                    <mat-option *ngFor="let option of field.options" [value]="option"> {{ option }} </mat-option>
                </mat-select>
            </ng-container>

            <!-- type text or number -->
            <input *ngSwitchDefault matInput [(ngModel)]="field.value">
        </ng-container>
    </ng-template>

    <button mat-icon-button matSuffix (click)="/* remove field */"><mat-icon>cancel</mat-icon></button>
</mat-form-field>
```

## Environment

<pre><code>
Angular version: 6.0.9
</code></pre>

## Related
#20810 and many others