Created by Gavin Mogan / @halkeye
Angular is a very opinionated framework.
Provides you with a lot of things, kinda like rails, but if you need to do things in way it doesn't support, then you spend a lot of time fighting with it.
ng-repeat confuses everyone
React is very non-opionated.
Doesn't do a lot for you, but very plugin friendly.
Data only flows one way.
With Angular if you wanted to change one value when other deep linked value changed, you'd have to use watches.
This would lead to very weird conditions, $apply statements wrapping code, etc
React only re-renders with attributes change, or state changes
No deep linking
var app = angular.module("testApp", []); app.controller("testController", function($scope) { $scope.name = "Gavin Mogan"; }); app.directive("helloWorld", function() { return { restrict: "E", template: " Hello, {{name}}!", scope: { name: "@" } }; });
var React = require('react'); var HelloWorld = React.createClass({ render() { return Hello,{this.props.name}!; } }); React.render(, document.body);
var React = require('react'); var Person = React.createClass({ render() { return {this.props.person.name}!; } }); var HelloWorld = React.createClass({ render() { returnHello,; } });!
Passing data can be tedious though
var React = require('react'); var Person = React.createClass({ render() { return {this.props.name}!; } }); var HelloWorld = React.createClass({ render() { returnHello,; } });!
Facebook has provided first class unit testing tools
var shallowRenderer = TestUtils.createRenderer();
shallowRenderer.render();
var component = shallowRenderer.getRenderOutput();
Then just make sure things are as you expect
expect(component.props.className).to.equal('MyComponent');
Comment {{$index}}:
var comments = this.props.comments.map(function(comment, idx) { return ( Comment {idx}:); }); {comments}
ngmin/ngannotate
Reactify/jsx
Can act as a controller like apparatus
Supposed to be IE8 compatible again next major release (with polyfills)
React-RouterTransitiveNumber2:00
{
"bootstrap-sass": "^3.3.4",
"consolelog": "^2.1.3",
"es5-shim": "^4.1.5",
"es6-shim": "^0.31.3",
"flux": "^2.0.3",
"flux-dispatcher": "^1.0.6",
"flux-store": "^1.1.5",
"font-awesome": "^4.3.0",
"html5shiv": "^3.7.2",
"i18next-client": "^1.9.0",
"isarray": "0.0.1",
"json-loader": "^0.5.2",
"json3": "^3.3.2",
"mirrorkey": "^1.2.0",
"object-assign": "^2.0.0",
"react": "^0.13.3",
"react-bootstrap": "^0.23.1",
"react-maskedinput": "^2.0.0",
"react-router": "^0.13.3",
"react-toggle": "^1.2.3",
"reqwest": "^1.1.5",
"store": "^1.3.17",
"whatwg-fetch": "^0.9.0"
}
Found many useful items while researching