Skip to content

Commit f1e2502

Browse files
committed
chore(sample): update animations to Angular 1.2
1 parent fd729ef commit f1e2502

File tree

5 files changed

+28
-14
lines changed

5 files changed

+28
-14
lines changed

sample/contacts.detail.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h2>{{contact.name}}</h2>
99
<a ui-sref="contacts.detail.item({itemId:item.id})">{{item.type}}</a>
1010
</li>
1111
</ul>
12-
<div ui-view ng-animate="{enter:'fade-enter'}">
12+
<div ui-view class="slide">
1313
<!-- Example of default content. This content will be replace as soon as
1414
this ui-view is populate with a template -->
1515
<small class="muted">Click on a contact item to view and/or edit it.</small>

sample/contacts.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
<button class="btn" ng-click="goToRandom()">Show random contact</button>
1919

2020
<!-- Another named view -->
21-
<div ui-view="menuTip"></div>
21+
<div ui-view="menuTip" class="slide"></div>
2222
</div>
2323
</div>
2424

2525
<!-- Our unnamed main ui-view for this template -->
26-
<div ui-view class="span9" ng-animate="{enter:'fade-enter'}"></div>
26+
<div ui-view class="span9 slide"></div>
2727
</div>

sample/index.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
<link rel="stylesheet" type="text/css" href="styles.css">
1111

1212
<!-- Include both angular.js and angular-ui-router.js-->
13-
<script src="../lib/angular-1.1.5.js"></script>
14-
<script src="../build/angular-ui-router.js"></script>
13+
<script src="../lib/angular-1.2.4/angular.js"></script>
14+
<script src="../lib/angular-1.2.4/angular-animate.js"></script>
15+
<script src="../release/angular-ui-router.js"></script>
1516

1617
<!-- module.js declares the uiRouterSample module and adds items to $rootScope-->
1718
<script src="module.js"></script>
@@ -50,7 +51,7 @@
5051

5152
<!-- Here is the main ui-view (unnamed) and will be populate by its immediate children's templates
5253
unless otherwise explicitly named views are targeted. It's also employing ng-animate. -->
53-
<div ui-view class="container" style="margin-top:60px" ng-animate="{enter:'fade-enter'}"></div>
54+
<div ui-view class="container slide" style="margin-top: 80px;"></div>
5455

5556

5657
<hr>

sample/module.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Make sure to include the `ui.router` module as a dependency
2-
angular.module('uiRouterSample', ['ui.router'])
2+
angular.module('uiRouterSample', ['ui.router', 'ngAnimate'])
33
.run(
44
[ '$rootScope', '$state', '$stateParams',
55
function ($rootScope, $state, $stateParams) {

sample/styles.css

+20-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
.fade-enter-setup, .fade-leave-setup {
2-
transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s;
1+
.slide.ng-leave {
2+
position: relative;
33
}
4-
.fade-enter-setup,
5-
.fade-leave-setup.fade-leave-start {
4+
.slide.ng-enter {
5+
position: absolute;
6+
}
7+
.slide.ng-enter, .slide.ng-leave {
8+
-webkit-transition: -webkit-transform 0.3s ease-in, opacity 0.3s ease-in;
9+
-moz-transition: -moz-transform 0.3s ease-in, opacity 0.3s ease-in;
10+
-o-transition: -o-transform 0.3s ease-in, opacity 0.3s ease-in;
11+
transition: transform 0.3s ease-in, opacity 0.3s ease-in;
12+
}
13+
.slide.ng-enter, .slide.ng-leave.ng-leave-active {
14+
-webkit-transform: scaleX(0.0001);
15+
-o-transform: scaleX(0.0001);
16+
transform: scaleX(0.0001);
617
opacity: 0;
718
}
8-
.fade-leave-setup,
9-
.fade-enter-setup.fade-enter-start {
19+
.slide, .slide.ng-enter.ng-enter-active {
20+
-webkit-transform: scaleX(1);
21+
-o-transform: scaleX(1);
22+
transform: scaleX(1);
1023
opacity: 1;
11-
}
24+
}

0 commit comments

Comments
 (0)