Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.