This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React-way</title> | |
<!-- Not present in the tutorial. Just for basic styling. --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TableRow = React.createClass({displayName: 'TableRow', | |
render: function() { | |
return ( | |
React.createElement('tr', {className: "tableRow"}, | |
"Table row" | |
) | |
); | |
} | |
}); | |
ReactDOM.render( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/babel"> | |
var Tweet = React.createClass({ | |
render: function() { | |
return ( | |
<div> | |
<TwitterHeader /> | |
<TwitterPoster /> | |
<TweetButton /> | |
</div> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/babel"> | |
var Tweet = React.createClass({ | |
render: function() { | |
var handleTags = this.props.tags.map(function(tag){ | |
return (<TwitterTags twitterTags={tag}/>); | |
}); | |
return ( | |
<div> | |
<TwitterHeader /> | |
<TwitterPoster /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/babel"> | |
var Tweet = React.createClass({ | |
getInitialState: function() { | |
return {suggestiontags: []}; | |
}, | |
componentDidMount: function() { | |
this.setState({suggestiontags: [{ id: 1, text: '#React' },{ id: 2, text: '#Angular' }]}); | |
}, | |
render: function() { | |
var handleTags = this.state.suggestiontags.map(function(tag){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/babel"> | |
var Tweet = React.createClass({ | |
getInitialState: function() { | |
return {suggestiontags: []}; | |
}, | |
componentDidMount: function() { | |
this.setState({suggestiontags: [{ id: 1, text: '#React' },{ id: 2, text: '#Angular' }]}); | |
}, | |
render: function() { | |
var handleTags = this.state.suggestiontags.map(function(tag){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//es5 | |
app.get('home',function(req,res){ | |
res.json({name: 'Rajika', universe: 'DC'}); | |
}); | |
//es6 arrow functions | |
app.get('home',(req,res) => { | |
res.json({name: 'Rajika', universe: 'DC'}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//es5 with require | |
var express = require('express'); | |
var app = express(); | |
//es6 import | |
import express from 'express'; | |
//then express is available as a variable | |
var app = express(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gulp from 'gulp'; | |
import rename from 'gulp-rename'; | |
import ngAnnotate from 'gulp-ng-annotate'; | |
import watch from 'gulp-watch'; | |
import nodemon from 'gulp-nodemon'; | |
gulp.task('minify',() => { | |
gulp.src('modules/**/*.js') | |
.pipe(rename({ | |
extname: '.min.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
users { | |
_id, | |
name, | |
age | |
} | |
} |
OlderNewer