Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialIain Simmons
Treehouse Moderator 32,305 PointsES2015 version of mean-todo
Hi all,
Lately I've been really getting into ES2015, and love the new syntax it provides, so I took it upon myself to convert this app to ES2015.
Getting the Angular stuff to work was a bit of a headache, but I got there eventually!
I've added the code to GitHub, so feel free to poke around/break it!
Also, I noticed one thing that didn't work quite right in the original app: if you mark things off as complete and refresh the page, they will appear as if the change didn't take effect in the database.
What is actually happening is that there's still the 'ng-init' directive/attribute on the ng-repeat
div in the public/templates/todo.html
file, and that is changing the initial value of todo.completed
to false
. Removing that will make everything work as expected (and the value will be obtained from the database).
3 Answers
Ken Howard
Treehouse Guest TeacherGood catch on the ng-init
directive! I'll see if we can get a note in the teacher's notes on that.
Patrick O'Dacre
15,471 PointsThank you for posting this.
Here is some relevant reading on the fat arrow function - https://blog.getify.com/arrow-this/
Graham Wright
Full Stack JavaScript Techdegree Student 15,197 PointsThanks, Ian. This is great. I was just pondering these exact same things.
Iain Simmons
Treehouse Moderator 32,305 PointsI've been trying to do all tutorials/courses in ES2015, even when they don't call for it. It's a good exercise, though it can be frustrating at times.