angular/packages/platform-server/test
Kristiyan Kostadinov a600a39d0c feat(core): add support for fallback content in ng-content (#54854)
Adds the ability to specify content that Angular should fall back to if nothing is projected into an `ng-content` slot. For example, if we have the following setup

```
@Component({
  selector: 'my-comp',
  template: `
    <ng-content select="header">Default header</ng-content>
    <ng-content select="footer">Default footer</ng-content>
  `
})
class MyComp {}

@Component({
  template: `
    <my-comp>
      <footer>New footer</footer>
    </my-comp>
  `
})
class MyApp {}
```

The instance of `my-comp` in the app will have the default header and the new footer.

**Note:** Angular's content projection happens during creation time. This means that dynamically changing the contents of the slot will not cause the default content to show up, e.g. if a `if` block goes from `true` to `false`.

Fixes #12530.

PR Close #54854
2024-03-26 09:17:59 -07:00
..
BUILD.bazel refactor(core): internal tracker of pending tasks during initial rendering (#49576) 2023-03-28 16:19:31 -07:00
hydration_spec.ts feat(core): add support for fallback content in ng-content (#54854) 2024-03-26 09:17:59 -07:00
integration_spec.ts refactor(platform-server): remove legacy URL handling logic (#54874) 2024-03-18 16:37:07 -07:00
transfer_state_spec.ts refactor(core): simplify state transfer escaping (#50201) 2023-05-10 11:31:34 -07:00