Notes
- In addition to the JavaScript file that creates the HTML element, a component’s folder can contain other JavaScript files.
- Use these JavaScript files to structure code in UI components, and share code from service components.
- These additional JavaScript files must be ES6 modules and must have names that are unique within the component’s folder.
This example uses the first pattern. Only myComponent.js can import code from utils.js and myFunction.js.
// myComponent.js
import { getAmount, calculateCost } from './utils';
import myFunction from './myFunction';
Video
Video does not exists.