- Learning Ionic(Second Edition)
- Arvind Ravulavaru
- 126字
- 2021-07-02 23:24:25
Modules and imports
In vanilla JavaScript, you must have observed code blocks like this:
(function(){
var x = 20;
var y = x * 30;
})(); //IIFE
// x & y are both undefined here.
Modules are achieved in ES6/TS using the imports and exports syntax:
logic.ts
export function process(){
x = 20;
y = x * 30;
}
exec.ts
import { process } from './logic';
process();
These are the bare essentials that we would need to get started with TypeScript. We will look at more such concepts where needed.
With this we wrap up the key concepts needed to get started with TypeScript. Let us get started with Angular.
For more information on TypeScript, check out: https://www.TypeScriptlang.org/docs/tutorial.html. Also check out the TypeScript introduction video: https://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript.
推薦閱讀
- Puppet 4 Essentials(Second Edition)
- 潮流:UI設(shè)計(jì)必修課
- Learning PostgreSQL
- 程序員面試筆試寶典
- Twilio Best Practices
- C語言程序設(shè)計(jì)立體化案例教程
- C語言程序設(shè)計(jì)案例式教程
- 嚴(yán)密系統(tǒng)設(shè)計(jì):方法、趨勢與挑戰(zhàn)
- Scala編程實(shí)戰(zhàn)(原書第2版)
- Learning Concurrent Programming in Scala
- Python極簡講義:一本書入門數(shù)據(jù)分析與機(jī)器學(xué)習(xí)
- Web性能實(shí)戰(zhàn)
- Learning Unreal Engine Game Development
- 官方 Scratch 3.0 編程趣味卡:讓孩子們愛上編程(全彩)
- LabVIEW入門與實(shí)戰(zhàn)開發(fā)100例(第4版)