Skip to content

Multiple Link Preview Containers on One Page #60

Description

@sinanspd

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

OS and Version?

Versions

Repro steps

The log given by the failure

Desired functionality

Mention any other details that might be useful

Activity

  1. AnthonyNahas commented on Apr 19, 2019

    @AnthonyNahas
    Member

    what do you mean with multiple link preview container ?

    The mat-link-preview-container component ?

    Did you try the multiple input ? It will allow you to render multiple links and url within one container..

    check this out

    Bildschirmfoto 2019-04-19 um 09 10 15

    Please feel free to provide more info about your feature request

  2. sinanspd commented on Apr 19, 2019

    @sinanspd
    Author

    Hi @AnthonyNahas
    Thank is not what I meant. Let's say we have two input fields for links (i.e. one for media articles, one for youtube videos/interviews)

      <form [formGroup]="pressForm">
           <mat-form-field appearance="outline">
                  <mat-label> New Article Links </mat-label>
                  <textarea matInput matTextareaAutosize matLinkPreview minRows="6" 
                         formControlName="articles"></textarea>	 
            </mat-form-field>
            <mat-link-preview-container [multiple]="true"></mat-link-preview-container> 
        </form>
    
        <form [formGroup]="videoForm">
                <mat-form-field appearance="outline">
    	 	   <mat-label> Video Links </mat-label>
    	            <textarea matInput matTextareaAutosize matLinkPreview minRows="6" 
                                        formControlName="videos"></textarea>	
                  </mat-form-field>
                   <mat-link-preview-container [multiple]="true"></mat-link-preview-container>
        </form>
    

    Now if we put a link inside the first text area, it renders the preview in both containers

    Screen Shot 2019-04-19 at 2 26 19 AM

    Ideally, it would be nice to be able to link input fields to specific containers so multiple instances can be used in the same component. Similar to how Angular Datepicker is implemented

  3. AnthonyNahas commented on May 4, 2019

    @AnthonyNahas
    Member

    I see! I will really appreciate a PR from you !!

  4. added
    enhancementNew feature or request
    and removed
    invalidThis doesn't seem right
    on May 4, 2019
  5. murilogoncalvesp commented on Nov 29, 2019

    @murilogoncalvesp

    Any news on this? It would be really nice.

  6. sinanspd commented on Nov 29, 2019

    @sinanspd
    Author

    Sorry I had no time to look into this. Have a quite lengthy backlog on my hands and this is towards the bottom. I am not a front end dev so I need to educate myself in type script a little bit before doing this. If anybody wants to pick it up feel free.

    From what I remember during my initial pass, this behavior is coming from the fact that the injected service is a singleton. An easy, obvious work around is to, instead of having a shared service, to init one per component but I think it is bad practice to do so.

    I think the best way to do this will be to pass the service some sort of identifier and keep the links in a map instead of a list. Datepicker, I believe achieves this through ViewChilds but as I said, I need to dig into datepicker to see exactly how they do it and the 30 files in the repo doesn't make it much easier. I need to block a good chunk of time to dig into that. Will try to get to this Q1 2020 hopefully.

  7. AnthonyNahas commented on Nov 30, 2019

    @AnthonyNahas
    Member

    no problem thank u

  8. sivarooban commented on Jul 2, 2020

    @sivarooban

    how to set linkpreview on page load

  9. removed their assignment
    on Sep 26, 2020
  10. java-sinon commented on Nov 30, 2020

    @java-sinon

    Any news on this?
    i am stuck.
    how to show preveiw on page load if we have url?

  11. AnthonyNahas commented on Nov 30, 2020

    @AnthonyNahas
    Member

    PR are welcome guys

  12. java-sinon commented on Dec 1, 2020

    @java-sinon

    PR are welcome guys

    any solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions