curiouswebster
asked on
Explain how TypeScript fits into Angular?
Explain how TypeScript fits into Angular?
I coded Angular 4 and am pretty sure I used TypeScript. But, I can not recall exactly where.
Please refresh my memory.
Thanks
I coded Angular 4 and am pretty sure I used TypeScript. But, I can not recall exactly where.
Please refresh my memory.
Thanks
ASKER
Can you give me an example of TypeScript to Javascript? I am still a bit unsure how this works under the covers.
For example, what variable and function name types are available?
For example, what variable and function name types are available?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So, let is a newer type which allows the transpiler select the type to use as it generates the javascript?
ASKER
thanks
You are welcome
let is used for local declarations (local to the block they are in) as opposed to var which declares a variable that is global to the entire function
So, let is a newer type which allows the transpiler select the type to use as it generates the javascript?Not sure what the question is?
let is used for local declarations (local to the block they are in) as opposed to var which declares a variable that is global to the entire function
ASKER
Sorry, that was an old thought I should have deleted...
TypeScript is basically a typed superset of JavaScript. Anything you can do in JavaScript you can do in TypeScript. The nice thing about TypeScript is
a) It allows you to type your variables, function returns etc - so the compiler does some key checking
b) It enables you to use the latest JavaScript functions and features without having to worry about backward compatibility
When you compile your Angular App - the TypeScript code is Transpiled into JavaScript, minified and tree shaken - ready to be published. It is not much more involved than that.