{"id":1996,"date":"2014-01-31T20:51:22","date_gmt":"2014-02-01T02:51:22","guid":{"rendered":"http:\/\/www.wiredprairie.us\/blog\/?p=1996"},"modified":"2014-01-31T20:51:22","modified_gmt":"2014-02-01T02:51:22","slug":"animating-an-elements-visibility-using-angularjs","status":"publish","type":"post","link":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1996","title":{"rendered":"Animating an element’s visibility using AngularJS"},"content":{"rendered":"

There was a question on StackOverflow about animating an element and I wanted to give it a shot, so here goes:<\/p>\n

http:\/\/jsfiddle.net\/wiredprairie\/5tFCZ\/1\/<\/a><\/p>\n

\"image\"<\/a><\/p>\n

 <\/p>\n

Imagine nearly the simplest Angular JS application possible:<\/p>\n

<<\/span>div<\/span> ng-app<\/span>="App"<\/span>><\/span>\n    <<\/span>div<\/span> ng-init<\/span>="checked=true"<\/span>><\/span>\n        <<\/span>div<\/span>><\/span>\n            <<\/span>label<\/span>><\/span>\n                <<\/span>input<\/span> type<\/span>="checkbox"<\/span> ng-model<\/span>="checked"<\/span> \/><\/span>Is Visible...<\/<\/span>label<\/span>><\/span>\n        <\/<\/span>div<\/span>><\/span>\n        <<\/span>div<\/span> class<\/span>="sample"<\/span> ng-class<\/span>="{ hidden: !checked }"<\/span>><\/span>Visible...<\/<\/span>div<\/span>><\/span>\n    <\/<\/span>div<\/span>><\/span>\n<\/<\/span>div<\/span>><\/span><\/pre>\n