Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Refactor @defered to a synthetic structural directive #1561

Closed
matanlurey opened this issue Aug 10, 2018 · 2 comments
Closed

Refactor @defered to a synthetic structural directive #1561

matanlurey opened this issue Aug 10, 2018 · 2 comments

Comments

@matanlurey
Copy link
Contributor

matanlurey commented Aug 10, 2018

The source of #1539 is that @deferred tries to be clever, and implements itself similar to a structural directive but doesn't go through all of the steps. It's trivial to add a workaround to fix #1539, but in the future it would be nice if:

<custom-comp @deferred></custom-comp>

... was basically a direct sugar of:

<template>
  <custom-comp></custom-comp>
</template>

... where <custom-comp> is constructed lazily (using the loadDeferred() logic).

@leonsenft
Copy link
Contributor

Isn't it already a direct sugar for

<template>
  <custom-comp></custom-comp>
</template>

?

https://github.com/dart-lang/angular/blob/75d190d59efd7795355649d995e94403ce351e59/angular_ast/lib/src/visitors/desugar_visitor.dart#L101-L105

@matanlurey
Copy link
Contributor Author

You're right. Then I have no idea why it generates different code than a typical <template>. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants