angular-animations

Angular NoopAnimationsModule Type Error matches Element is not a function

我们两清 提交于 2019-12-04 22:47:48
I'm getting this error after importing NoopAnimationsModule for my Angular 6 app ERROR TypeError: this.driver.matchesElement is not a function at TransitionAnimationEngine.push../node_modules/@angular/animations/fesm5/browser.js.TransitionAnimationEngine.processLeaveNode (browser.js:2976) This happened to me a few hours ago, and was probably caused by some outdated modules. Running npm update --save fixed it. @angular/core and @angular/animations should be same version. Especially look for "^" symbol in package name in package.json . It should be "@angular/core": "6.0.5", "@angular/animations"

Angular 4 animation for fade in and out a view

北城以北 提交于 2019-12-04 18:03:32
I just want the view to fade in and out on route change. I have setup the component correctly it seems but need to get the animation syntax correct I think. This is my current animation attempt. I import this animation to my component: import {trigger, state, animate, style, transition} from '@angular/animations'; export function routerTransition() { return fadeInAndOut(); } function fadeInAndOut() { return trigger('routerTransition', [ transition(':enter', [ style({opacity: 0}), animate(3000, style({opacity: 1})) ]), transition(':leave', [ animate(3000, style({opacity: 0})) ]) ]); } This is

Expand input width dynamically to the length of string

时光总嘲笑我的痴心妄想 提交于 2019-12-04 10:09:02
I am trying to create an input field that expands at least in width dynamically with the length of the string the user entered, probably even multiline. Is that possible with an input element in Angular Material 2? With the textarea field from Angular Material 2 I only managed to expand the textarea in height, not in width with the following code: <mat-form-field (keydown.enter)="onEnter()" floatPlaceholder="never"> <textarea matInput placeholder="Autosize textarea" matTextareaAutosize matAutosizeMinRows="1" matAutosizeMaxRows="8"> </textarea> </mat-form-field> also on StackBlitz . In case of

Angular 4 animate parent and child components at the same time

你说的曾经没有我的故事 提交于 2019-12-04 07:53:08
I've written plunk to illustrate my issue: LINK I need to animate parent component, and at the same time I want to make some animation in child component. It seems that angular is blocking animation on child component, and then simply jumps states after parent animation ends without any transition. Is there any way to make animations work in parallel, or at least chain without using callbacks? @Component({ selector: 'outer', template: ` <div [@state]="state" (mouseenter)="state='wide'" (mouseleave)="state='narrow'" style="background-color: red;"> <inner [stateInner]="state"></inner> </div>`,

Angular Animations : How to bind animation trigger name dynamically in the template?

帅比萌擦擦* 提交于 2019-12-04 02:27:54
问题 I would like to know if there is a way to bind the animation trigger name dynamically in the template. Here is the div to animate in the template app.component.html : <div [@animationTriggerName]> ... </div> Here is the app.module.ts : ... @NgModule({ imports: [...], declarations: [ ..., AnimationTriggerNameDirective ], bootstrap: [...] }) And here is the app.component.ts : @Component({ ... }) export class AppComponent { ... animationTriggerName = 'slideInOut'; } @Directive({ selector: '

Slide down animation Angular 4

别来无恙 提交于 2019-12-03 16:29:18
问题 I am trying to animate my page but have the following issue: I have content div on my page, and a button that opens another div above the content. I would like that div to fade and slide in, and the div bellow to slide down/up as well. I created the animation I wanted for the div above that opens on click, but don't understand what to do with content div, example code bellow: <div class="wrapper"> <button (click)="animated = !animated"></button> <div *ngIf="animated" [@slideInOutAnimation]

Slide down animation Angular 4

試著忘記壹切 提交于 2019-12-03 05:41:30
I am trying to animate my page but have the following issue: I have content div on my page, and a button that opens another div above the content. I would like that div to fade and slide in, and the div bellow to slide down/up as well. I created the animation I wanted for the div above that opens on click, but don't understand what to do with content div, example code bellow: <div class="wrapper"> <button (click)="animated = !animated"></button> <div *ngIf="animated" [@slideInOutAnimation] class="animated-div"> THIS DIV IS ANIMATED</div> <div class="content">THIS IS CONTENT DIV</div> </div>

What is the purpose of Angular animations?

流过昼夜 提交于 2019-12-03 01:09:56
问题 I've been wondering for some time now why should I use Angular animations over CSS animations . I see few areas one might consider before using them: Performance In the first step I found this question which deals only with performace side of things. The accepted answer is not satisfying for me because it states that one should use CSS animations wherever possible so that optimizations like running the animations in separate thread can apply . This doesn't seem to be true, because Angular

Angular 2 Staggering Animation

折月煮酒 提交于 2019-12-01 20:09:04
问题 Angular 2 RC2 just came out and I am wondering whether it already supports staggered animations for *ngFor ? The DSL language documentation mentions group and sequence but no stagger of any kind? Is staggered animation not included in RC2? 回答1: I'm not sure if I agree with Günter that the ng-conf features are in the newest RC.3 or for that matter in the RC.4 release. A stagger feature would be excellent but as of current that doesn't look like it's slated for RC.5. It will definitely be in

Angular 2 Staggering Animation

旧时模样 提交于 2019-12-01 18:59:29
Angular 2 RC2 just came out and I am wondering whether it already supports staggered animations for *ngFor ? The DSL language documentation mentions group and sequence but no stagger of any kind? Is staggered animation not included in RC2? wootencl I'm not sure if I agree with Günter that the ng-conf features are in the newest RC.3 or for that matter in the RC.4 release. A stagger feature would be excellent but as of current that doesn't look like it's slated for RC.5. It will definitely be in the Angular 2 Final release as you can see on this animation tracking ticket . With that being said