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
Dom Smith
3,091 PointsWhy does AngularJS ng-click not work within <td> tag?
Hi people,
I am using the AngularJS ng-click to show content on the page when the user clicks the necessary button.
When the I have the line of code(button) responsible for doing this in a table <td> tag the content doesn't appear when the button is accessed.
However when the the same button is placed out of the table tag completely it works fine.
Find the code snippet below
<table> <tr> <td><button class="btn btn-small btn-success" ng-click="print=true" type="button">Confirmation</button></td> </tr> </table>
<div ng-show="print"> <h1>Hello World</h1> </div>
Basically this button work unless it is outside of the table tag, why does this occur and how do I solve this problem?
Thanks in advice.
Dom Smith
3,091 PointsDom Smith
3,091 PointsAlthough the snippet says different, the H1 tag is wrapped in a div as follows
<div ng-show="print"</div>