https://github.com/ghoul007/angular-content-projection
ngTemplateOutlet vs ngContent
https://github.com/ghoul007/angular-content-projection
Last synced: 14 days ago
JSON representation
ngTemplateOutlet vs ngContent
- Host: GitHub
- URL: https://github.com/ghoul007/angular-content-projection
- Owner: ghoul007
- Created: 2019-10-03T09:00:01.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T10:20:18.000Z (over 2 years ago)
- Last Synced: 2025-04-04T20:40:41.380Z (3 months ago)
- Language: TypeScript
- Size: 1.77 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Content projection
Content projection is a way to import HTML content from outside the component and insert that content into the component’s template in a designated spo## The problem ( When using NG-Content )
The problem is that 'nested' components are immediately initialized and not destroyed when removed from DOM.
## Solution ( Using template outlet )
```js
```
[Example with loader](https://stackblitz.com/edit/angular-dscswb)