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 trialSnow Girl
Full Stack JavaScript Techdegree Student 11,438 Points{{todo.name}} is flashing on refresh?
Is anyone else seeing the {{todo.name}} code flashing on refresh within the label in this lesson phase?
4 Answers
akak
29,446 PointsThis sometimes happens and there is a angular directive to fix it. You can add ng-cloak in a div that flickers.
<div id="template2" ng-cloak>
and then in CSS
[ng-cloak] {
display: none;
}
Now the scope variables won't show up until they are rendered with data.
Saleh Jarad
3,087 PointsYou can simply Change it like this: <h2>{{todo.name}}</h2> <--[To] --> <h2 data-ng-bind="todo.name"></h2>
Ve Ship
Courses Plus Student 17,996 PointsI also had this problem. The flashing was fixed when I removed the 'coolCtrl' controller from <div class="actions"> from the previous exercise in index.html.
<div ng-controller="mainCtrl" class="list">
<input ng-model="todo.completed" type="checkbox"/>
<label ng-hide="editing" class="editing-label" ng-click="">{{todo.name}}</label>
<input ng-show="editing" ng-model="todo.name" class="editing-label" type="text"/>
<div class="actions">
<a href="" ng-click="editing = !editing">edit</a>
<a href="" ng-click="">save</a>
<a href="" class="delete">delete</a>
</div>
</div>
Saleh Jarad
3,087 PointsUse > data-ng-bind="todo.name" inside the element. instead {{todo.name}}
Antonio Jaramillo
15,604 PointsAntonio Jaramillo
15,604 PointsWow! Nice to know.