0

Вообщем проблема, у меня есть Angular 2 анимация

trigger('focusPanel', [
    state('inactive', style({
         transform: 'scale(1)'
    })),
    state('active', style({
        transform: 'translateX(535px)'
    })),

    transition('inactive=>active', animate('600ms', keyframes([
    style({
    transform: 'translate3d(0px, 0, 0)'
  }),style({
     opacity: 1,
     transform: 'translate3d(325px, 0, 0)'
  }),style({
    transform: 'translate3d(420px, 0, 0)'
  }),style({
    transform: 'translate3d(550px, 0, 0)'
  }),style({
    transform: 'translate3d(525px, 0, 0)'
  }),style({
    transform: 'translate3d(540px, 0, 0)'
  }),style({
    transform: 'translate3d(525px, 0, 0)'
  }),style({
    transform: 'translate3d(535px, 0, 0)'
  }),

функция

toggleMove(){
        this.state = (this.state === 'inactive' ? 'active': 'inactive');
}

при клике на submit input уезжает, но проблема в том что когда он пустой анимация все равно срабатывает. Вопрос как сделать чтобы только при заполненом input срабатывала анимация.

1 ответ 1

0
<input ... [@focusPanel]="state" [@.disabled]="myInputIsEmpty">

https://angular.io/api/animations/trigger#disable-animations

1
  • Большое спасибо!!!
    – Forg
    15 окт 2017 в 9:43

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.