diff options
Diffstat (limited to 'src/ng/directive/ngView.js')
| -rw-r--r-- | src/ng/directive/ngView.js | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/src/ng/directive/ngView.js b/src/ng/directive/ngView.js index 2ffd64da..5b6d938b 100644 --- a/src/ng/directive/ngView.js +++ b/src/ng/directive/ngView.js @@ -21,7 +21,7 @@ * * @scope * @example - <example module="ngView"> + <example module="ngView" animations="true"> <file name="index.html"> <div ng-controller="MainCntl"> Choose: @@ -31,7 +31,10 @@ <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> | <a href="Book/Scarlet">Scarlet Letter</a><br/> - <div ng-view></div> + <div + ng-view + class="example-animate-container" + ng-animate="{enter: 'example-enter', leave: 'example-leave'}"></div> <hr /> <pre>$location.path() = {{$location.path()}}</pre> @@ -43,14 +46,58 @@ </file> <file name="book.html"> - controller: {{name}}<br /> - Book Id: {{params.bookId}}<br /> + <div> + controller: {{name}}<br /> + Book Id: {{params.bookId}}<br /> + </div> </file> <file name="chapter.html"> - controller: {{name}}<br /> - Book Id: {{params.bookId}}<br /> - Chapter Id: {{params.chapterId}} + <div> + controller: {{name}}<br /> + Book Id: {{params.bookId}}<br /> + Chapter Id: {{params.chapterId}} + </div> + </file> + + <file name="animations.css"> + .example-leave-setup, .example-enter-setup { + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + -moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + -ms-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + } + + .example-animate-container { + position:relative; + height:100px; + } + + .example-animate-container > * { + display:block; + width:100%; + border-left:1px solid black; + + position:absolute; + top:0; + left:0; + right:0; + bottom:0; + padding:10px; + } + + .example-enter-setup { + left:100%; + } + .example-enter-setup.example-enter-start { + left:0; + } + + .example-leave-setup { } + .example-leave-setup.example-leave-start { + left:-100%; + } </file> <file name="script.js"> |
