Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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!

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #component #tags
ADD COMMENT
Topic
Name
8+8 =