This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/directives/components/testComponent.js
2016-10-14 12:03:28 -04:00

21 lines
545 B
JavaScript

/**
* A react component implemented using the ngReact library
*/
var testComponent = React.createClass({
propTypes: {
prop1: React.PropTypes.string.isRequired,
prop2: React.PropTypes.string.isRequired
},
render: function() {
return React.DOM.span(null,
'This is a react component: ' + this.props.prop1 + ' ' + this.props.prop2
);
}
});
angular.module('quayPages')
.value('TestComponent', testComponent)
.directive('testComponent', function(reactDirective) {
return reactDirective(testComponent);
});