Answers for "angular component between tags"

2

angular component between tags

//  <ng-content></ng-content>
@Component({
  selector: 'app-demo',
  template: '<div>{{title}}</div>
             <br>
             <ng-content></ng-content>',
})
export class DemoComponent {
  title = 'Works!';
}

//Content to be projected:

<app-demo>This is projected content!</app-demo>

//The output will be:

Works!
This is projected content!
Posted by: Guest on October-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language