Skip to content

Instantly share code, notes, and snippets.

@AnteaterKit
Last active December 25, 2020 15:04
Show Gist options
  • Save AnteaterKit/b437f087c404d7cac7fffff99ee69c0e to your computer and use it in GitHub Desktop.
Save AnteaterKit/b437f087c404d7cac7fffff99ee69c0e to your computer and use it in GitHub Desktop.
@Component({
selector: 'uikit-card',
exportAs: 'uiKitCard',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: `
<div class='ui-card'>
<div class='ui-card-title'>
<div class='ui-card-title-text'>
{{title}}
</div>
</div>
<div class='ui-card-content'>
<ng-content></ng-content>
</div>
<div class='ui-card-actions' *ngIf='actions.length'>
<span class='ui-card-actions__action' *ngFor='let action of actions'>
<span>
<ng-template [ngTemplateOutlet]="action"></ng-template>
</span>
</span>
</div>
</div>
`,
styleUrls: ['./card.component.scss']
})
export class CardComponent implements OnInit {
@Input()
title = '';
@Input()
actions: Array<TemplateRef<void>> = [];
constructor() { }
ngOnInit(): void {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment