the router is that 'thing' that parses the url and based on that assembles your application #javascript #routing #angular2 #ng2router
let obj = { oddType: +this.match[`CompetitorsType${this.odd}`] || 'X' } // +this.. coerces to number, otherwise 'X', #javascript #es2015
1
2
"no component should be allowed to mutate any data that it doesn't own" - @teropa for the third time. #javascript #componentarchitecture
1
the key thing about declarative knowledge is it says that something is true, but doesn't tell you how to do it #computerscience #javascript
imports: [SomeModule] List of modules to import into. all from the imported modules is available to all of its declarations #angular2 #ng2
a #decorator is just a #function that 'decorates' a target for example, another function or class #javascript #typescript #angular2
1
migrating from #angularjs to #angular2 is easy if you don't depend on external libraries, otherwise you going to suffer!!! #javascript
#javascript Functions can use objects to remember results of previous operations, making it possible to avoid unnecessary work - memoization
#javascript #es2015 import creates #immutable bindings export let c = 0 export () => c += 1 /// import {c} from './c' c += 1 //SyntaxError
const f = tweet => { let newTweet = tweet; newTweet.id = blabla; //BUG! mutating both tweet and newTweet }; #javascript #mutate is wrong
or you might do something like getFullYear.bind (new Date)() //2017
#javascript you can't destructure let {getFullYear} = new Date() getFullYear() //Uncaught TypeError getFullYear.call(new Date) //2017
1
1
A callback is a function passed as a parameter to another function that performs an asynchronous operation. #javascript #asyncishard
fetch API isn't part of #javascript? It just part of the #browser? #omfg