ngreact implementation wip
This commit is contained in:
parent
2174fe589b
commit
6d375e33bf
7 changed files with 20680 additions and 8 deletions
|
@ -2,15 +2,38 @@
|
|||
/**
|
||||
* Repository view page.
|
||||
*/
|
||||
angular.module('quayPages').config(['pages', function(pages) {
|
||||
pages.create('repo-view', 'repo-view.html', RepoViewCtrl, {
|
||||
'newLayout': true,
|
||||
'title': '{{ namespace }}/{{ name }}',
|
||||
'description': 'Repository {{ namespace }}/{{ name }}'
|
||||
|
||||
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')
|
||||
.config(['pages', function(pages) {
|
||||
pages.create('repo-view', 'repo-view.html', RepoViewCtrl, {
|
||||
'newLayout': true,
|
||||
'title': '{{ namespace }}/{{ name }}',
|
||||
'description': 'Repository {{ namespace }}/{{ name }}'
|
||||
});
|
||||
}])
|
||||
.value('TestComponent', testComponent)
|
||||
.directive('testComponent', function(reactDirective) {
|
||||
return reactDirective(testComponent);
|
||||
});
|
||||
}]);
|
||||
|
||||
function RepoViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel, ImageLoaderService, CookieService) {
|
||||
$scope.reactProps = {
|
||||
prop1: 'Prop 1',
|
||||
prop2: 'Prop 2'
|
||||
};
|
||||
|
||||
$scope.namespace = $routeParams.namespace;
|
||||
$scope.name = $routeParams.name;
|
||||
|
||||
|
@ -155,4 +178,4 @@
|
|||
loadImages(callback);
|
||||
};
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
|
Reference in a new issue