Skip to content

Instantly share code, notes, and snippets.

@vxhviet
Created February 22, 2019 16:03
Show Gist options
  • Save vxhviet/ad664239e357ce45ce3d9fcd80b766d1 to your computer and use it in GitHub Desktop.
Save vxhviet/ad664239e357ce45ce3d9fcd80b766d1 to your computer and use it in GitHub Desktop.

Angular animation style's attributes

SOURCE

Use camel case for CSS attribute Angular animation style:

animations: [
  trigger('openClose', [
    // ...
    state('open', style({
      height: '200px',
      opacity: 1,
      backgroundColor: 'yellow',  // <-- camel case
      borderRadius: '10px' // <-- camel case
    })),
    state('closed', style({
      height: '100px',
      opacity: 0.5,
      backgroundColor: 'green', // <-- camel case
      borderRadius: '50px'  // <-- camel case
    })),
    transition('* => closed', [
      animate('1s')
    ]),
    transition('* => open', [
      animate('0.5s')
    ]),
  ]),
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment