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

Jonathan Broderick
Jonathan Broderick
12,409 Points

ng-show and ng-hide not working

<!doctype html> <html> <head> <title>Treehouse Angular TodoApp</title> <link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet" type="text/css"> <link href="styles/main.css" rel="stylesheet" type="text/css"/> </head> <body ng-app="todoListApp">

<h1>My TODOs</h1>

<div ng-controller="mainCtrl" class="list">
  <input ng-model="todo.completed" type="checkbox"/>
  <label ng-hide="editing" class="editing-label">{{todo.name}}</label>
  <input ng-show="editing" ng-model="todo.name" class="editing-label" type="text"/>
  <div>
    <a href="" ng-click"editing = !editing">edit</a>
    <a href="" ng-click="helloWorld()">save</a>
    <a href="" class="delete">delete</a>
  </div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js" type="text/javascript"></script>
<script src="scripts/app.js" type="text/javascript"></script>

</body> </html>

Everything looks the same as Huston's code does in the video, but my input field is gone, and clicking the edit button does nothing. Am I missing something?

Jonathan Broderick
Jonathan Broderick
12,409 Points

Nevermind! I found the devious missing = on my edit button's ng-click directive.