You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the <FaIcon> component with an element that has a fa-layers-text class, I'm unable to use a dynamic value for the text.
When trying to use the layers-text feature with the add I originally had a problem applying a data-fa-transform to it. @jrjohnson kindly gave me the following code to make it work:
//new-icon.js
import Component from '@ember/component';
import {
dom,
} from '@fortawesome/fontawesome-svg-core';
import {
next
} from '@ember/runloop';
export default class NewIcon extends Component {
scanDom(element) {
next(() => {
dom.i2svg({
node: element
});
});
}
}
//new-icon.hbs
<span class="fa-layers fa-lg mr-1" {{did-insert (fn this.scanDom)}}>
<FaIcon @icon="circle" @size="2x" />
<span class="fa-layers-text text-white" data-fa-transform="grow-8">
text
</span>
</span>
This worked great, however if I use a passed value in place of text like {{@text}}, the SVG does not update to reflect the new value.
I did try to achieve it with a {{did-insert}} modifier like this:
Even though I can confirm that the {{@score}} value has in fact updated in the component, it still doesn't update the SVG with the correct value. I'd expect the text in the SVG to update alongside the passed in value.
Let me know if you need any more information or have any other tips for me to try.
The text was updated successfully, but these errors were encountered:
When using the
<FaIcon>
component with an element that has afa-layers-text
class, I'm unable to use a dynamic value for the text.When trying to use the
layers-text
feature with the add I originally had a problem applying adata-fa-transform
to it. @jrjohnson kindly gave me the following code to make it work:This worked great, however if I use a passed value in place of
text
like{{@text}}
, the SVG does not update to reflect the new value.I did try to achieve it with a
{{did-insert}}
modifier like this:Even though I can confirm that the
{{@score}}
value has in fact updated in the component, it still doesn't update the SVG with the correct value. I'd expect the text in the SVG to update alongside the passed in value.Let me know if you need any more information or have any other tips for me to try.
The text was updated successfully, but these errors were encountered: