August 2017
Beginner
298 pages
7h 4m
English
Our custom element now contains the HTML needed for displaying the contents. Let's test it. At the end of your Weather.js file, add the following line:
export default Weather;
This will export the entire Weather class and make it available to be used inside other modules. We need to import this into our home.js file. Inside your home.js file, add the following code at the top:
import Weather from './CustomElements/Weather/Weather';
Next, we need to define the custom element, that is, associate the custom element with a tag name. Ideally, we would like to call our element <weather>. It would be nice! But according to the custom element spec, we should name the element so that it has a dash - in its name. So, for ...
Read now
Unlock full access