We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add question & answer about ng-content.
The text was updated successfully, but these errors were encountered:
@Shashidharknaik Can you create PR?
Sorry, something went wrong.
Example:
my-button.component.ts
import { Component, OnInit } from '@angular/core'; @Component({ selector: 'my-button', template: ` <button class='action-btn' (click)="action()"> <ng-content></ng-content> </button> ` }) export class MyButtonComponent implements OnInit { constructor() { } ngOnInit() { } action(){ console.log("action triggered") } }
app.component.html
<my-button> Button 1 </my-button> <my-button> Button 2 </my-button>
allows you to add dynamic content inside a custom component.
Using , we can create the same with different labels.
helps us achieve transclusion in Angular.
No branches or pull requests
Please add question & answer about ng-content.
The text was updated successfully, but these errors were encountered: