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!

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 AngularJS Basics (1.x) Using Angular's Built In Directives Adding Data To Your App Using ng-model

Akshit Jindal
Akshit Jindal
1,341 Points

$scope.todo.name is not working.

When I update $scope.todo.name="abcd" in my mainCtrl and tries to run the project. The initial value doesn't show up in my html page. Instead it is showing {{todo.name}} on my html page. Error message shown in the console is Cannot set property 'name' of undefined. Thanks in advance!

1 Answer

Justin Cantley
Justin Cantley
18,068 Points

It's possible that your entering the expression outside of the scope. Without seeing your html and angular code it's hard to tell.