- Hands-On Full Stack Web Development with Angular 6 and Laravel 5
- Fernando Monteiro
- 99字
- 2021-07-23 19:18:51
Importing and using external classes
An import can be accomplished with the keyword import, and can be declared in different ways, depending on what library you are using. An example of using Require.js is as follows:
- Go back to your text editor, create a file called import.ts, and add the following code:
import MyBand = require('./export');
console.log(Myband());
An example of using Common.js is as follows:
import { MyBand } from './export';
console.log(new Myband(['ZZ Top', 'Motorhead'], 3));
- The second method has been adopted by the Angular team, because Angular uses Webpack, a module bundler building modern web applications.
推薦閱讀
- 網(wǎng)絡(luò)教育學(xué)習(xí)指導(dǎo)
- Aptana Studio Beginner's Guide
- 微商之道
- 物聯(lián)網(wǎng)安全與深度學(xué)習(xí)技術(shù)
- 物聯(lián)網(wǎng)信息安全
- 物聯(lián)網(wǎng)關(guān)鍵技術(shù)及應(yīng)用
- WordPress 5 Complete
- 信息通信網(wǎng)絡(luò)建設(shè)安全管理概要2
- 2018網(wǎng)信發(fā)展報(bào)告
- 區(qū)塊鏈輕松上手:原理、源碼、搭建與應(yīng)用
- 物聯(lián)網(wǎng)通信技術(shù)
- 網(wǎng)絡(luò)AI+:2030后的未來網(wǎng)絡(luò)
- 園區(qū)網(wǎng)絡(luò)架構(gòu)與技術(shù)
- LwIP應(yīng)用開發(fā)實(shí)戰(zhàn)指南:基于STM32
- 基于IPv6的家居物聯(lián)網(wǎng)開發(fā)與應(yīng)用技術(shù)