Quantcast
Channel: Hacker News 50
Viewing all articles
Browse latest Browse all 9433

Facebook’s New React JavaScript Library Tutorial Rewritten in AngularJS — Make Your Own Apps — Medium

$
0
0

Comments:"Facebook’s New React JavaScript Library Tutorial Rewritten in AngularJS — Make Your Own Apps — Medium"

URL:https://medium.com/make-your-own-apps/e71bcedc36b


Update: Thank you guys for voting me up to the top of Hacker News!

Facebook React is a new JavaScript framework. I found their official tutorial for creating a comment box (like Disqus or Facebook Comments) and I wanted to re-create this app in AngularJS.

In the AngularJS version below, the HTML speaks for itself.

And the entire JavaScript required to

1) power the form, 2) redraw the comments, and 3) render Markdown in HTML

appears below.

Of course, we may want to save the new comment to a server, so we simply add a few more lines:

And if we want to automatically update the comments every 5 seconds, we simply add the following lines:

For an interactive demo, I created a jsFiddle here: http://jsfiddle.net/vla/Cdrse/

What does the Facebook “React” tutorial look like? Here you go!

That’s all for today! Check back this page tomorrow for a more in-depth discussion or follow me on twitter: @vla.

If you like this post, I’m launching a KickStarter project to help me complete a new AngularJS book and video suite aimed at beginners or server-side minded folks, with special rewards for early birds. Please enter your email address here to be notified when it’s available! Thank you!

You can follow me on twitter: @vla. I’m vlad on Hacker News and GitHub. No recruiters, please.


Viewing all articles
Browse latest Browse all 9433

Trending Articles