Initial processing
Let's change index.html and index.js to the following
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title> sample </title> <script id="fs-js" src="http://localhost:8000/js/fairysupport.min.js" data-page-root="http://localhost:8000/page"></script> </head> <body> <div data-obj="obj"></div> <div><button data-name="sample">sample</button></div> </body> </html>index.js
export class Index { constructor() { console.log("constructor"); console.log('obj' in this); } init() { console.log("init"); console.log('obj' in this); } sample_click(event) { alert("Hello fairysupport"); } }
The web page and js are not yet binded in the constructor
When the web page and js are binded together, the framework calls the init method
Next page constants
table of contents