I have been following the slideUp guide here: http://ng.malsup.com/#!/css-animations-for-ng-hide_ng-show
Apart from i want the opposite effect. Instead of sliding up/hiding on click, i want the content to slide down/appear on click. So, the content is hidden on load. I have created a plunker here, but doesnt seem to work: http://plnkr.co/edit/12wPKGqn4g3Fctm7NKnA
HTML:
<ul>
<li ng-repeat-start="item in data">
<p>Name: {{item.name}} <span ng-click="example1=!example1">+</span></p>
</li>
<li ng-repeat-end class="cssSlideUp" ng-hide="example1">
DOB: {{item.dob}}
Gender: {{item.gender}}
</li>
</ul>
CSS:
.ng-hide-add, .ng-hide-remove {
/* ensure visibility during the transition */
display: block !important; /* yes, important */
}
.cssSlideUp {
transition: .3s linear all;
height: 100px;
overflow: hidden;
}
.cssSlideUp.ng-hide {
height:0;
}
It doesnt feel like ng-animate is being successfully added as a dependency.
UPDATE:
Updated plunker: http://plnkr.co/edit/Vwuin1KLrNUDSkfv7cBy?p=preview
Please see that demo : http://plnkr.co/edit/N6fPYgipvML2rzmEt4So?p=preview
it looks like you need to change a bit structure of your DOM
<ul>
<li ng-repeat="item in data">
<p>Name: {{item.name}} <span ng-click="example1=!example1">+</span></p>
<p class="cssSlideUp" ng-hide="example1">
DOB: {{item.dob}}
Gender: {{item.gender}}
</p>
</li>
</ul>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With