20 lines
587 B
JavaScript
20 lines
587 B
JavaScript
/**
|
|
* A react component implemented using the ngReact library
|
|
*/
|
|
var testComponent = React.createClass({
|
|
propTypes: {
|
|
firstProp: React.PropTypes.string.isRequired,
|
|
secondProp: React.PropTypes.string.isRequired
|
|
},
|
|
render: function() {
|
|
return React.DOM.span(null,
|
|
'This is a react component: ' + this.props.firstProp + ' ' + this.props.secondProp
|
|
);
|
|
}
|
|
});
|
|
|
|
angular.module('quayPages').value('test-component', testComponent);
|
|
angular.module('quayPages').directive('testComponent', function(reactDirective) {
|
|
return reactDirective('testComponent');
|
|
});
|
|
|