What a great technological analogy by Mandy Michael. A reminder that TypeScript...
makes use of static typing so, for example, you can give your variables a type when you write your code and then TypeScript checks the types at compile time and will throw an error if the variable is given a value of a different type.
In other words, you have a variable
age that you declare to be a
number, the value for
age has to stay a number otherwise TypeScript will yell at you. That type checking is a valuable thing that helps thwart bugs and keep code robust.
This is the same with HTML. If you use the
<div>everywhere, you aren’t making the most of language. Because of this it’s important that you actively choose what the right element is and don’t just use the default
And hey, if you're into TypeScript, it's notable it just went 3.0.
Essentially a way to import a block of dependancies (scripts and styles) into an HTML document.
<link rel="import" href="imports.html">
It doesn't actually just plop the content from the referenced file where you call it though, like an
@import does in CSS or and include does in a server side language. HTML could very much use that.
The following is a guest post by Rob Dodson (@rob_dodson). Rob and I were going back and forth in CodePen support getting Polymer (a web components polyfill, kinda) working on a demo of his. We did get it working, and things kind of evolved into this article. Take it away Rob.
Update: Rob updated this article on March 5, 2014, getting everything up to date, as this is a rather fast-moving technology at the moment.
Update: Updating again September 9, 2014!