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

feat(vite-plugin-angular): allows host bindings on <template> #1024

Merged
merged 8 commits into from
Apr 11, 2024

Conversation

nartc
Copy link
Member

@nartc nartc commented Apr 11, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Which package are you modifying?

  • vite-plugin-angular
  • vite-plugin-nitro
  • astro-angular
  • create-analog
  • router
  • platform
  • content
  • nx-plugin
  • trpc

What is the current behavior?

Currently, we bind properties and events on the Host element by using defineMetadata()

<script lang="ts">
  defineMetadata({
    host: { class: 'flex flex-col gap-2', '(click)': 'handleClick($event)' }
  });

  function handleClick(event: PointerEvent) {
    console.log('clicked on host', event);
  }
</script>

<template>
  <aside></aside>
  <main></main>
</template>

Closes #

What is the new behavior?

Allow <template> to accept host bindings

<script lang="ts">
  function handleClick(event: PointerEvent) {
    console.log('click on host', event);
  }
</script>

<template class="flex flex-col gap-2" (click)="handleClick($event)">
  <aside></aside>
  <main></main>
</template>

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

[optional] What gif best describes this PR or how it makes you feel?

Copy link

netlify bot commented Apr 11, 2024

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit 5801bc6
🔍 Latest deploy log https://app.netlify.com/sites/analog-blog/deploys/6617777bca8fe60008644d7d
😎 Deploy Preview https://deploy-preview-1024--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 11, 2024

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit 5801bc6
🔍 Latest deploy log https://app.netlify.com/sites/analog-app/deploys/6617777b715478000837d1ac
😎 Deploy Preview https://deploy-preview-1024--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 11, 2024

Deploy Preview for analog-ng-app ready!

Name Link
🔨 Latest commit 5801bc6
🔍 Latest deploy log https://app.netlify.com/sites/analog-ng-app/deploys/6617777b7b5c5b0008cc72b3
😎 Deploy Preview https://deploy-preview-1024--analog-ng-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nartc nartc requested review from brandonroberts and a team April 11, 2024 05:39
@nartc nartc self-assigned this Apr 11, 2024
@nartc nartc added the enhancement New feature or request label Apr 11, 2024
@nartc nartc changed the title Feat/template host binding feat(vite-plugin-angular): allows host bindings on <template> Apr 11, 2024
Copy link

netlify bot commented Apr 11, 2024

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit 5801bc6
🔍 Latest deploy log https://app.netlify.com/sites/analog-docs/deploys/6617777b1ace1e0007f69e4e
😎 Deploy Preview https://deploy-preview-1024--analog-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@brandonroberts brandonroberts merged commit e3455b2 into analogjs:beta Apr 11, 2024
23 checks passed
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

Successfully merging this pull request may close these issues.

4 participants