View gist:f2d8146081eaba4a453dfbd615e99180
import React, { Component } from 'react';
import Typography from '../../node_modules/@material-ui/core/Typography';
import { withStyles } from '../../node_modules/@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import Paper from '@material-ui/core/Paper';
View Le code utilise le Spread Operator, le Rest parameter ainsi que le Default Value en ES6
const address = {
city: "Lyon",
state: "FR",
zip: 69001
};
const sportList = ['Football', 'BasketBall']
const otherSportList = ['Boxe', 'Judo']
const allsports = [...sportList, ...otherSportList]
View MyTimer.js
import React, {Component} from 'react';
class MyTimer extends Component {
constructor(props) {
super(props)
this.state = {temps: 0}
}
timer() {
this.setState({
View SignUp.js
import React, {Component} from 'react';
class SignUp extends Component {
constructor(props) {
super(props);
this.state = { email : 'Tape ton email' };
this.updateEmailField= this.updateEmailField.bind(this)
}
updateEmailField(event) {
View app.js
import React, { Component } from 'react';
let mdpfaible = /^[a-z]{1,6}$/g;
let mdpMoyen = /^(?=.*[a-z])(?=.*[A-Z])[a-zA-Z]{7,}$/g;
let mdpFort = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[@@!%*?&])[A-Za-z@@!%*?&]{7,}/g
class Password extends Component{
constructor(props){
super(props);
View myprecious.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" >
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sauron is very good bro.</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
View Author.js
import React, { Component } from 'react';
class Author extends Component {
click(){
alert('Parfait');
}
render(){
View app.js
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var usersRouter = require('./routes/users');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var app = express();
View app.js
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var usersRouter = require('./routes/users');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var app = express();
View delete-user.pug
extends layout
block content
form(method='POST', action='/users/' + id + '?_method=DELETE')
h1= title
p Supprimer l'utilisateur.
button(type='submit') Supprimez