Josh Finnie
Software Maven @ TrackMaven
https://github.com/davidchang/ngReact
ngReact is an Angular module that allows React Components to be used in AngularJS applications.
(aka A way to sneak in React.js code into Angular!)
var app = angular.module('app', ['react']);
app.controller('mainCtrl', function($scope) {
$scope.person = {
firstName: 'Josh',
lastName: 'Finnie'
};
});
var Hello = React.createClass({
propTypes: {
firstName: React.PropTypes.string.isRequired,
lastName: React.PropTypes.string.isRequired
},
render: function() {
return React.DOM.span(null,
'Hello ' + this.props.firstName + ' ' + this.props.lastName
);
}
});
app.value("Hello", Hello);
app.directive('hello', function(reactDirective) {
return reactDirective(Hello);
});
https://github.com/joshfinnie/ngReact-Sandbox
@joshfinnie
http://www.joshfinnie.com