You need to sign in to do that
Don't have an account?
Umar Farooq 50
Getting Error unexpected token: a floating point number
Getting following error for the code :
<img src="{!$ContentAsset.03S1w0000004Z6l}" alt="TLogo" class="tlogo"/>
Error:
Failed to save xxxxxx.cmp: unexpected token: a floating point number at column 14 of expression: $ContentAsset.03S1w0000004Z6l: Source
<img src="{!$ContentAsset.03S1w0000004Z6l}" alt="TLogo" class="tlogo"/>
Error:
Failed to save xxxxxx.cmp: unexpected token: a floating point number at column 14 of expression: $ContentAsset.03S1w0000004Z6l: Source
Hi Umar,
I think you are trying to load img from static resource.try following way.
In Lightning Aura Component
<img src="{!$Resource.yourStaticResourceName}" alt="test"/>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
And If you want to load img in Lwc than try following way.
In html
<img src={resource} alt="test"/>
In Js
import yourStaticResourceName from '@salesforce/resourceUrl/yourStaticResourceName';
export default class yourClassName extends LightningElement {
resource=yourStaticResourceName ;
}
let me know if it's helps you and marking it as best. so that it could help to others.
Thank you