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

21 lines
587 B
JavaScript
Raw Normal View History

2016-10-14 15:40:13 +00:00
/**
* A react component implemented using the ngReact library
*/
var testComponent = React.createClass({
propTypes: {
firstProp: React.PropTypes.string.isRequired,
secondProp: React.PropTypes.string.isRequired
2016-10-14 15:40:13 +00:00
},
render: function() {
return React.DOM.span(null,
'This is a react component: ' + this.props.firstProp + ' ' + this.props.secondProp
2016-10-14 15:40:13 +00:00
);
}
});
angular.module('quayPages').value('test-component', testComponent);
angular.module('quayPages').directive('testComponent', function(reactDirective) {
return reactDirective('testComponent');
});
2016-10-14 15:40:13 +00:00