Repository: angular
Issue: @Self() does not work when using Injector.create()
Labels: area: core,core: di,core: dynamic view creation,P3,bug

### Which @angular/* package(s) are the source of the bug?

core

### Is this a regression?

No

### Description

A structural directive `ShowIf` works with `ViewContainerRef.createEmbeddedView()` with custom injector created with `Injector.create()` to provide some tokens. `@Self()` decorator is not working in child or projected components of `ShowIf` applied component.

```ts
import {
  Component,
  Directive,
  Inject,
  InjectionToken,
  Injector,
  Input,
  Self,
  TemplateRef,
  ViewContainerRef,
} from '@angular/core';

const TOKEN_A = new InjectionToken<string>('Token A');
const TOKEN_B = new InjectionToken<string>('Token B');

@Component({
  selector: 'my-app',
  template: `
  <button (click)="show = !show">{{show ? 'Hide' : 'Show'}}</button>
  <comp-a *showIf="show">
    <comp-b></comp-b>
  </comp-a>
  `,
})
export class AppComponent {
  show = false;
}

@Component({
  selector: 'comp-a',
  template: `
  <p>Child</p>
  <comp-b></comp-b>
  <p>Projected</p>
  <ng-content></ng-content>
  `,
  providers: [{ provide: TOKEN_A, useValue: 'Apple' }],
})
export class ComponentA {
  constructor(@Inject(TOKEN_A) private tokenA: string) {
    // Will use tokenA here
  }
}

@Component({
  selector: 'comp-b',
  template: `<pre>
TokenA: "{{tokenA}}" < Should break
TokenB: "{{tokenB}}"
</pre>`,
  providers: [
    // No TOKEN_A provider here
  ],
})
export class ComponentB {
  constructor(
    // Used @Self() but not provided TOKEN_A
    @Self() @Inject(TOKEN_A) public tokenA: string,
    @Inject(TOKEN_B) public tokenB: string
  ) {}
}

@Directive({ selector: '[showIf]' })
export class ShowIf {
  private hasView = false;

  constructor(
    private templateRef: TemplateRef<any>,
    private viewContainer: ViewContainerRef
  ) {}

  @Input() set showIf(condition: boolean) {
    if (condition && !this.hasView) {
      this.viewContainer.createEmbeddedView(this.templateRef, undefined, {
        injector: Injector.create({
          providers: [
            // Need to provide some tokens here
            { provide: TOKEN_B, useValue: 'Orange' },
          ],
        }),
      });
      this.hasView = true;
    } else if (!condition && this.hasView) {
      this.viewContainer.clear();
      this.hasView = false;
    }
  }
}
```
I've used `@Self()` in `ComponentB` but never provided `TOKEN_A` in it's `@Component` decorator. I would expect it to break. But I can see the value of `TOKEN_A` provided in `ComponentA`.

### Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-ivy-tswazi?file=src/app/app.component.ts

### Please provide the exception or error you saw

```true
None
```


### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI: 14.2.6
Node: 18.12.1 (Unsupported)
Package Manager: npm 8.19.2 
OS: linux x64

Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1402.6 (cli-only)
@angular-devkit/core         14.2.6 (cli-only)
@angular-devkit/schematics   14.2.6 (cli-only)
@schematics/angular          14.2.6 (cli-only)
```
```


### Anything else?

I have to use the custom injector.