August 2017
Beginner
298 pages
7h 4m
English
Time to code! Keep Webpack dev server running with the npm run watch command (the NODE_ENV variable should be dev). Open the project folder in VSCode and open the home.js file from the src/js/ directory. I have already added a reference to dist/home.js in the index.html file. I would have also added code to import the general.js file in home.js. Now, add the following code below the import statement:
class Home { constructor() { }}window.addEventListener("load", () => { new Home();});
This will create a new class Home and will create a new instance of it when the page has completed loading. We need not assign the instance object to any variables because we are not going to use it inside the HTML file like we ...
Read now
Unlock full access