Skip to content

Reloading capability #11

Open
Open

Description

@mohammedzamakhan

We need to have reloading capability that could be called whenever a URL fails to load (maybe because of the network issues).

Activity

  1. tomastrajan commented on Aug 31, 2019

    @tomastrajan
    Member

    This is going to get so awesome in the end !

  2. felipeplets commented on Sep 28, 2020

    @felipeplets
    Contributor

    @mohammedzamakhan I'm trying to understand the use case so that it is clear to the contributor that actually implements it.

    The use case I'm envisioning for this is something like:

    • Specify a loading error template using the existing errorTemplate that can contain a button that enables reloading
    • When pressing the button, a reload function should be called that would retry to load the component.

    Some pseudo code illustrating the example:

    <ng-template #error><button (click)="() => mwcButton.retry();">retry</button></ng-template>
    <mwc-button
            #mwcButton
            *axLazyElement="
              'https://unpkg.com/wrong-url.js?module';
              errorTemplate: error;
              module: true
            "
            raised
          >
            Submit
          </mwc-button>
    

    So in this case the mwcButton.retry is the API we would be looking to implement.

    @mohammedzamakhan @tomastrajan is this what you are thinking in terms of API and ergonomics for this feature?

  3. tomastrajan commented on Oct 22, 2020

    @tomastrajan
    Member

    Hi @felipeplets! Thanks for the suggestion.

    The way I think about this is that the directive could expose .reload() method which then could be accesses using local template variable as you suggested and also using @ViewChild(AxLazyElementDirective) right ?

    Service could also expose .reload(tag: string) method ?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions