Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular2动画学习资源_Angular_Ng Animate - Fatal编程技术网

Angular2动画学习资源

Angular2动画学习资源,angular,ng-animate,Angular,Ng Animate,除了www.angular.io上的基本API参考之外,是否有任何好的/深入的资源可用于学习Angular2中的动画?Angular2中的动画在开发过程中多次发生变化,并且在RC2中再次发生变化,虽然这项技术还没有正式提供,也没有文件记录。正如文章顶部所说,RC2中有一个新的库 我承认我没有试过RC2,但这是我的想法。您不需要动画库(大多数情况下)。只需将css转换与类和样式指令一起使用即可 例如,使用以下代码可以实现与链接文章类似的功能: import { Component } from '

除了www.angular.io上的基本API参考之外,是否有任何好的/深入的资源可用于学习Angular2中的动画?

Angular2中的动画在开发过程中多次发生变化,并且在RC2中再次发生变化,虽然这项技术还没有正式提供,也没有文件记录。正如文章顶部所说,RC2中有一个新的库

我承认我没有试过RC2,但这是我的想法。您不需要动画库(大多数情况下)。只需将css转换与
样式
指令一起使用即可

例如,使用以下代码可以实现与链接文章类似的功能:

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  template: `
             <button (click)='toggleHeight()'>Show/Hide</button>
             <div [style.height]='divHeight'>
                Sed ut perspiciatis unde omnis iste natus error sit
                voluptatem accusantium doloremque laudantium, totam
                aperiam, eaque ipsa quae ab illo inventore...
             </div>
            `,
   styles:  [`
              div {
                overflow-y: hidden;
                transition: height 2s ease;
              }
            `]
})
export class AppComponent {
    divHeight: string = '500px';
    shown: boolean = true;

    toggleHeight() {
        this.shown = !this.shown
      this.divHeight = this.shown? '500px' : '0';
    }
}
从'@angular/core'导入{Component};
@组成部分({
选择器:“我的应用程序”,
模板:`
显示/隐藏
所有人都能清楚地看到错误所在
多洛雷姆药膏
我是一个发明家。。。
`,
风格:[`
div{
溢出y:隐藏;
过渡:高度2秒;
}
`]
})
导出类AppComponent{
divHeight:string='500px';
显示:布尔值=真;
切换高度(){
this.show=!this.show
this.divHeight=this.show?'500px':'0';
}
}

Angular 2中的动画在开发过程中多次发生变化,在RC2中再次发生变化,虽然这项技术还没有正式提供,也没有文件记录。正如文章顶部所说,RC2中有一个新的库

我承认我没有试过RC2,但这是我的想法。您不需要动画库(大多数情况下)。只需将css转换与
样式
指令一起使用即可

例如,使用以下代码可以实现与链接文章类似的功能:

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  template: `
             <button (click)='toggleHeight()'>Show/Hide</button>
             <div [style.height]='divHeight'>
                Sed ut perspiciatis unde omnis iste natus error sit
                voluptatem accusantium doloremque laudantium, totam
                aperiam, eaque ipsa quae ab illo inventore...
             </div>
            `,
   styles:  [`
              div {
                overflow-y: hidden;
                transition: height 2s ease;
              }
            `]
})
export class AppComponent {
    divHeight: string = '500px';
    shown: boolean = true;

    toggleHeight() {
        this.shown = !this.shown
      this.divHeight = this.shown? '500px' : '0';
    }
}
从'@angular/core'导入{Component};
@组成部分({
选择器:“我的应用程序”,
模板:`
显示/隐藏
所有人都能清楚地看到错误所在
多洛雷姆药膏
我是一个发明家。。。
`,
风格:[`
div{
溢出y:隐藏;
过渡:高度2秒;
}
`]
})
导出类AppComponent{
divHeight:string='500px';
显示:布尔值=真;
切换高度(){
this.show=!this.show
this.divHeight=this.show?'500px':'0';
}
}

但还不可用-可能是RC2但还不可用-可能是plunkr示例的RC2银行。你对使用像流行的animate.css这样的动画库来处理动画与编写和测试代码片段中显示的原始css有什么看法?如果它有你想要使用的动画,我肯定会使用它。动画一直是javascript库的一个需求特性,但您可以看到css动画非常简单(1行!),而且如果您知道自己在做什么(我不知道),它也非常强大。为什么要增加应用程序代码的复杂性?样式(包括动画)属于样式表。感谢plunkr示例。你对使用像流行的animate.css这样的动画库来处理动画与编写和测试代码片段中显示的原始css有什么看法?如果它有你想要使用的动画,我肯定会使用它。动画一直是javascript库的一个需求特性,但您可以看到css动画非常简单(1行!),而且如果您知道自己在做什么(我不知道),它也非常强大。为什么要增加应用程序代码的复杂性?样式(包括动画)属于样式表。