-
-
Save kuncevic/924dcd2f9375ae46c552e9366b440bb4 to your computer and use it in GitHub Desktop.
Angular 4 ng-template & ng-container with parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ng-template #followingpost let-author="author" let-age="age" let-text="text" let-badge="badge"> | |
<div class="container-fluid"> | |
<div class="card"> | |
<div class="header"> | |
<h4 class="title">{{ author }}</h4> | |
<p class="category">il y a {{ age }} jours</p> | |
</div> | |
<div class="content" [innerHTML]="text"> | |
</div> | |
<div class="text-right"> | |
<button class="btn btn-icon btn-simple"><i class="ti-comment"></i></button> | |
<button class="btn btn-icon btn-simple"> | |
<i class="ti-heart"></i> | |
<span *ngIf="badge" class="badge">{{ badge }}</span> | |
</button> | |
<button class="btn btn-icon btn-simple"><i class="ti-share"></i></button> | |
</div> | |
</div> | |
</div> | |
</ng-template> | |
<ng-container *ngTemplateOutlet="followingpost;context:{author: 'Timothy', age: 2, badge: 18, text: 'Les Français qui payent plus de 2500 € d impôt peuvent bénéficier de cette loi : <a href=`http://bit.ly/2xxMicY`>http://bit.ly/2xxMicY</a>'}"></ng-container> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment