Paweł Grabarz
Anna Konopka
...and how are they influenced by your environment?
<component-a>
<div ng-repeat="item in data">
<component-b>
<span> Templates are great! </span>
</component-b>
</div>
</component-a>
bindings and $digest cycle
Angular 1.x
<ComponentA>
{
data.map(item => (
<ComponentB>
<span>JSX is great!</span>
</ComponentB>
));
}
</ComponentA>
React
virtual DOM diffing
<ComponentA boo={1}>
<ComponentB>
<span>I can use JSX</span>
</ComponentB>
</ComponentA>
<component-a :boo="1">
<component-b>
<span>and templates</span>
</component-b>
</component-a>
the same DOM updates mechanism
XSS, anyone?
$ ember new my-project
$ ng new my-project
$ create-react-app my-project
$ create-preact-app my-project
$ vue init webpack my-project
$ yarn run haul init
Cutting edge
Stable
$('#i').love(jQuery)
$("#nice-button").click(function() {
$("#thingy").animate({
opacity: 0.25,
left: "+=50",
height: "toggle"
}, 5000);
});
fetch(url).then(r => r.json())
.then(data => console.log(data))
.catch(e => console.log(":("))
Fetch API
CSS Transitions
Better DOM Api
document.querySelector('div.hello')
.zoom {
transition: transform 250ms;
}
.zoom:hover {
transition: transform 1s;
transform: scale(2);
}
import * as everything from ‘universe’
UI elements
DOM synchronization
User actions
API
Data management
Routing
var expr = 'foo';
var obj = {
get [expr]() { return 'bar'; }
};
console.log(obj.foo); // "bar"
<div ng-controller="MyCtrl">
Hello, {{name}}!
</div>
<script>
var myApp = angular.module('myApp',[]);
myApp.controller('MyCtrl', MyCtrl)
function MyCtrl($scope) {
$scope.name = 'Code Europe';
}
</script>
<div ng-controller="MyCtrl">
Hello, {{getName()}}!
</div>
<script>
var myApp = angular.module('myApp',[]);
myApp.controller('MyCtrl', MyCtrl)
function MyCtrl($scope) {
$scope.getName = () => {
debugger;
return 'Code Europe';
}
}
</script>
<div id="app">
Hello, {{ getName() }}
</div>
<script>
new Vue({
el: '#app',
methods: {
getName () {
debugger
return 'Code Europe'
}
}
})
</script>
Questions?