Skip to content

Commit 33a617a

Browse files
Roy SivanRoy Sivan
authored andcommitted
side by side working
1 parent 6d49c22 commit 33a617a

19 files changed

+19885
-143
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
bower_components/*
2-
bower_components
2+
bower_components
3+
node_modules/*
4+
*.log
5+
6+
npm-debug.log

assets/css/ang_react.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
body {
2-
background: purple; }
2+
background: white; }

assets/css/bootstrap_custom.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,7 @@ body {
10071007
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
10081008
font-size: 14px;
10091009
line-height: 1.42857;
1010-
color: #333333;
1011-
background-color: #fff; }
1010+
color: #333333; }
10121011

10131012
input, button, select, textarea {
10141013
font-family: inherit;

assets/js/angular_app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ reang = angular.module('reang', ['ngResource'])
77
})
88
.controller( 'reang_controller', ['$rootScope', '$scope', 'Posts', function($rootScope, $scope, Posts){
99
Posts.query({}, function(res){
10-
console.log(res);
10+
$scope.posts = res;
1111
});
12-
})
12+
}]);

assets/js/react_app.js

Whitespace-only changes.

assets/js/react_app.jsx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
var React = require('react');
2+
var $ = jQuery;
3+
4+
var Post = React.createClass({
5+
render: function(){
6+
return (
7+
<article>
8+
<h1>{this.props.post.title}</h1>
9+
{this.props.post.content}
10+
</article>
11+
)
12+
}
13+
})
14+
15+
16+
var App = React.createClass({
17+
18+
getposts: function() {
19+
console.log('getting posts..');
20+
$.ajax({
21+
url: 'http://dclient.dev/wp-json/posts',
22+
dataType: 'json',
23+
method: 'GET',
24+
success: function(res){
25+
console.log( res );
26+
this.setState({data:res})
27+
}.bind(this)
28+
});
29+
},
30+
31+
getInitialState: function() {
32+
return { data: [{ title: 'test'}] }
33+
},
34+
35+
componentDidMount: function() {
36+
this.getposts();
37+
},
38+
39+
render: function() {
40+
if(this.state.data.length) {
41+
return (
42+
<div>
43+
{this.state.data.map(function(post){
44+
return (
45+
<Post post={post}></Post>
46+
)
47+
})}
48+
</div>
49+
)
50+
}
51+
}
52+
});
53+
54+
React.render(<App/>, document.getElementById( 'test_react' ) );

assets/js/scripts.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
var $ = jQuery;
2-
3-
$(document).ready(function(){
4-
console.log('here');
5-
})
1+
var $ = jQuery;

assets/scss/ang_react.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
body {
2-
background: purple;
2+
background: white;
33
}

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"dependencies": {
1414
"angular": "~1.3.15",
1515
"angular-resource": "~1.3.15",
16-
"react": "~0.13.1"
16+
"bootstrap-sass": "~3.3.4"
1717
}
1818
}

build/css/styles.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
body {
2-
background: purple;
2+
background: white;
33
}
44
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
55

@@ -1406,7 +1406,6 @@ body {
14061406
font-size: 14px;
14071407
line-height: 1.42857;
14081408
color: #333333;
1409-
background-color: #fff;
14101409
}
14111410

14121411
input,

build/js/react_angular.min.js

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)