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
const App = () => { | |
return ( | |
<div className="container"> | |
<div className="starter-template"> | |
<h1>React Project</h1> | |
</div> | |
</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
<div class="container"> | |
<div class="starter-template"> | |
<h1>Angular Project</h1> | |
</div> | |
</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
import React from 'react'; | |
import Header from './components/header'; | |
const App = () => { | |
return ( | |
<div className="container"> | |
<div className="starter-template"> | |
<Header /> | |
</div> | |
</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
<div> | |
<ul class="list-unstyled"> | |
<li class="media" *ngFor="let row of tweets; let i = index"> | |
<img class="img-thumbnail rounded-circle mr-3" [src]="row?.account?.img" /> | |
<div class="media-body"> | |
<h5 class="mt-0 mb-1">{{row?.account?.fullName || "You"}}</h5> | |
<p class="text-muted">Posted at: {{row.createdAt}}</p> | |
{{row.content}} | |
<div class="mt-2"> | |
<a href="#"> |
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 React from 'react'; | |
// ...BackendService, classnames | |
import NewTweet from './NewTweet'; | |
class ListTweets extends React.Component { | |
// ...constructor, componentDidMount, getTweets | |
onAdd(tweet) { | |
this.backendService.addTweet(tweet) | |
.then((data) => { |
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
<form (ngSubmit)="onAdd()"> | |
<div class="form-group"> | |
<input | |
type="text" name="content" | |
placeholder={{placeholder}} | |
[(ngModel)]="model.content"> | |
</input> | |
</div> | |
<button type="submit" class="btn btn-primary">Submit</button> | |
</form> |
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 React from 'react'; | |
import BackendService from '../../../services/backend'; | |
import { Field, reduxForm } from 'redux-form'; | |
import classnames from 'classnames'; | |
export const required = value => value ? undefined : 'Field is required'; | |
const renderField = ({ | |
input, | |
placeholder, |
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
<form #regForm="ngForm" (ngSubmit)="onAdd()"> | |
<div class="form-group"> | |
<textarea | |
type="text" name="content" | |
required | |
[ngClass]="{'form-control':true,'is-invalid':!regForm.form.valid && regForm.form.touched}" | |
placeholder={{placeholder}} | |
[(ngModel)]="model.content"> | |
</textarea> | |
<div class="invalid-feedback" *ngIf="!regForm.form.valid && regForm.form.touched"> |
OlderNewer