Skip to content
New issue

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

Provide an alternate way to fill entries #7

Open
guillaumegarcia13 opened this issue Mar 16, 2018 · 0 comments
Open

Provide an alternate way to fill entries #7

guillaumegarcia13 opened this issue Mar 16, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@guillaumegarcia13
Copy link
Contributor

guillaumegarcia13 commented Mar 16, 2018

I would be great to provide an entryValues attibute to fill the entries for the timeline.
Something along the line of:

interface IEntryValue {
    date: Date;
    header: string;
    content?: string;
    color?: string;
    size?: number;
}

that would allow a sorting of events by date , and so on...

Right now, without this entryValues attribute, one alternative could be:

<mgl-timeline [alternate]="'false'" class="fcom-timeline">
     <mgl-timeline-entry *ngFor="let entry of timelineEntries">
         <!-- Header -->
         <mgl-timeline-entry-header>
             <strong>{{ entry.date | date:'d-MMM' }}</strong>
             <div class="text-muted" [innerHTML]="entry.header | safe:'html'"></div>
         </mgl-timeline-entry-header>

         <!-- Content -->
         <mgl-timeline-entry-content>
             <div [innerHTML]="entry.content | safe:'html'"></div>
         </mgl-timeline-entry-content>

         <mgl-timeline-entry-dot [color]="entry.color" [size]="entry.size"></mgl-timeline-entry-dot>
         <mgl-timeline-entry-side>{{ entry.date | date:'d MMMM yy' }}</mgl-timeline-entry-side>
     </mgl-timeline-entry>
</mgl-timeline>

RM: safe is a custom pipe allowing parsing of string as HTML

@glutengo glutengo added the enhancement New feature or request label Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants