- 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.
推薦閱讀
- 計算機網絡與通信(第2版)
- 自動駕駛網絡:自智時代的網絡架構
- 物聯網智慧安監技術
- Go Web Scraping Quick Start Guide
- 信息通信網絡建設安全管理概要2
- 企業私有云建設指南
- React:Cross-Platform Application Development with React Native
- Socket.IO Real-time Web Application Development
- 電力物聯網工程技術原理與應用
- 中國互聯網發展報告2018
- Mastering Dart
- Building Web Applications with ArcGIS
- 局域網組成實踐
- Implementing NetScaler VPX?
- Selenium WebDriver 3 Practical Guide