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

innerHTML / Binding not working #298

Closed
hmarcelodn opened this issue Feb 1, 2016 · 6 comments
Closed

innerHTML / Binding not working #298

hmarcelodn opened this issue Feb 1, 2016 · 6 comments
Labels

Comments

@hmarcelodn
Copy link

Hi guys,

I have an element like the one below

innerHTML.bind="filler(col, item)"

I need to be able to bind the raw HTML returned attributes. In my example I need to bind value attr. Example

    this.renders["check"] = function(col, item){
        return '<input type="input" value.bind="${hola}"/>';
    };

How can I accomplish that?

Thanks.

@Mordred
Copy link

Mordred commented Feb 1, 2016

Try innerhtml.bind instead of innerHTML.bind

@jdanyow
Copy link
Contributor

jdanyow commented Feb 1, 2016

The innerhtml binding doesn't compile templates- docs here: http://aurelia.io/docs.html#/aurelia/framework/1.0.0-beta.1.1.1/doc/article/cheat-sheet

More info on using the view-compiler here:
aurelia/templating#35

In general you want to avoid using aurelia this way- there are often better approaches using html templating than construction your markup from strings.

@AStoker
Copy link

AStoker commented Feb 22, 2016

This might be a separate issue. If so, let me know.
I'm using the innerHTML.bind on an svg for a custom element. This works in all browsers by IE.

<template>
    <svg innerHTML.bind="svgParts"></svg>
</template>

svgParts is a string that represents the insides of an svg. Works on everything by IE.
For comparison, if i used textcontent.bind, that works fine for putting text inside the svg. But I actually need the inner html to be set.

@jdanyow
Copy link
Contributor

jdanyow commented Feb 22, 2016

@AStoker please do open a separate issue- additional details about the version(s) of IE and a running example would be appreciated!

@hmarcelodn
Copy link
Author

@AStoker I tried to use Aurelia sintax inside an Aurelia loop context and it was not working. Is that your case? I had to change my approach to get what I wanted. Guys here says it doesnt compile Aurelia sintax inside strings. I will looking forward to your running example. Thanks!

@AStoker
Copy link

AStoker commented Feb 23, 2016

@hmarcelodn, no, that's not my case. I'll open a new story with an example. Edge and IE both have horrible support for SVG stuff, and my guess is the way they're loading up the html content just isn't supported by the browser.

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

No branches or pull requests

4 participants