Skip to content

$unsafe helper #98

Answered by KevinBatdorf
SimoTod asked this question in Ideas
Mar 10, 2021 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Could this some how work to load in something like this:

// external-file.js
<div x-data="myComponent"></div>
<script>
window.myComponent = function() {}
</script>

then

<div x-data x-html="content.length ? $unsafe(content) : 'loading...'"></div>
// content would be fetched and be the contents of external-file.js

Essentially making for an easy way to include partials?

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@SimoTod
Comment options

SimoTod Mar 10, 2021
Maintainer Author

Answer selected by SimoTod
Comment options

SimoTod
Mar 10, 2021
Maintainer Author

You must be logged in to vote
3 replies
@KevinBatdorf
Comment options

@SimoTod
Comment options

SimoTod Mar 10, 2021
Maintainer Author

@KevinBatdorf
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants