Skip to content

Reloading capability #11

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

Open
mohammedzamakhan opened this issue Aug 31, 2019 · 3 comments
Open

Reloading capability #11

mohammedzamakhan opened this issue Aug 31, 2019 · 3 comments

Comments

@mohammedzamakhan
Copy link
Contributor

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

@tomastrajan
Copy link
Member

This is going to get so awesome in the end !

@felipeplets
Copy link
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?

@tomastrajan
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants