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 trial

JavaScript Building a MEAN Application More TODO with the MEAN Stack Using Angular-wrapped JavaScript APIs

ES2015 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!

iainsimmons/mean-todo

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).

Huston Hedinger

3 Answers

Ken Howard
STAFF
Ken Howard
Treehouse Guest Teacher

Good 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
Patrick O'Dacre
15,471 Points

Thank you for posting this.

Here is some relevant reading on the fat arrow function - https://blog.getify.com/arrow-this/

I'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.