我们可以在父组件中通过 ngComponentOutlet 的ngComponentOutletInputs 属性来传递这个输入属性: typescript import { Component } from '@angular/core'; import { SayHiComponent } from './say_hi.component'; @Component({ selector: 'app-root', template: ` <button (click)="showComponent = SayHiCo...
1. Binding inputs and outputs A simple variant of binding through the parent component. @Component({template:`<ng-container *ngxComponentOutlet="component"></ng-container>`// using@ngxd/core 👆})classMyComponent{// your dynamic component 👇component=DynamicComponent;// 🥳 inputs and outp...
Now we need to export the 'au-tab-panel' component's method to the custom template, to do that we can use template ref: <ng-template#headerButtons><button(click)="tabPanel.selectTab(loginTab)">Login</button><button(click)="tabPanel.selectTab(signUpTab)">Sign up</button></ng-templat...
Now we need to export the 'au-tab-panel' component's method to the custom template, to do that we can use template ref: <ng-template#headerButtons><button(click)="tabPanel.selectTab(loginTab)">Login</button><button(click)="tabPanel.selectTab(signUpTab)">Sign up</button></ng-templat...
@Input() headerTemplate: TemplateRef<any>; 1. 2. 3. 4. Now we need to check whether the custom template passed in or not, if passed in then we use custom template, otherwise the default template. <ng-template#defaultTabHeader let-tabs="tabsX"><ulclass="tab-panel-buttons"*ngIf="tab...