Last active
June 7, 2023 07:30
-
-
Save RatanPaul/70f2284eedbd09a04e9462a5e685b3d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement } from 'lwc'; | |
import { ShowToastEvent } from 'lightning/platformShowToastEvent'; | |
import { loadScript, loadStyle } from 'lightning/platformResourceLoader'; | |
import ChatResource from '@salesforce/resourceUrl/Chat_Application_LWC'; | |
export default class Chat_Application extends LightningElement { | |
renderedCallback() { | |
Promise.all([ | |
loadScript(this, ChatResource + '/js/jquery.min.js'), | |
loadScript(this, ChatResource + '/js/jquery.mCustomScrollbar.min.js'), | |
loadScript(this, ChatResource + '/js/bootstrap.min.js'), | |
loadStyle(this, ChatResource + '/css/jquery.mCustomScrollbar.min.css'), | |
loadStyle(this, ChatResource + '/css/bootstrap.min.css'), | |
loadStyle(this, ChatResource + '/css/all.css') | |
]).then(() => { | |
this.dispatchEvent( | |
new ShowToastEvent({ | |
title: 'Success loading Files', | |
message: 'Successfully loaded JS and CSS', | |
variant: 'Success' | |
}) | |
); | |
}) | |
.catch(error => { | |
this.dispatchEvent( | |
new ShowToastEvent({ | |
title: 'Error loading Files', | |
message: error.message, | |
variant: 'error' | |
}) | |
); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment