angular/packages/platform-server
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
..
init refactor(platform-server): replace global usages with globalThis (#52342) 2023-10-24 09:26:50 -07:00
src refactor(platform-server): remove legacy URL handling logic (#54874) 2024-03-18 16:37:07 -07:00
test feat(core): add support for fallback content in ng-content (#54854) 2024-03-26 09:17:59 -07:00
testing build: configure cross-pkg resolution for api extraction (#52499) 2024-01-05 11:27:34 -08:00
BUILD.bazel build: configure cross-pkg resolution for api extraction (#52499) 2024-01-05 11:27:34 -08:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json build: update node.js engines version to be more explicate about v20 support (#52448) 2023-10-31 14:18:36 -07:00
PACKAGE.md docs: update SSR doc to reflect version 17 (#52398) 2023-10-26 12:30:59 -07:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00