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 trialBappy Golder
13,449 PointsWhere is the value `editing` coming from. Or previously the value `completed` came from?
I don't understand where we are getting these values from?
2 Answers
Joey Munroe
430 PointsIn Angular you can define new variables in html without the variables having been defined in the controller. The editing variable was defined on the fly.
Faris Almomen
5,153 PointsHow does angular know the initial value for those variables defined on the fly? it seems the "todo.completed" is initialized as false since the page renders all the boxes unchecked.. is that correct?
Tony Brackins
28,766 PointsFaris Almomen Angular knows because it's a checkbox. If it's empty, it will be false. if it's checked it will be true.
Matthew Day
6,740 PointsMatthew Day
6,740 PointsThis answer might shed more light on what's going on: https://teamtreehouse.com/community/where-did-editing-in-nghideediting-or-ngclick-editing-editing-come-from