Custom Animation Component Ionic 2 RC0 and Angular 2 -
since moving ionic 2 rc0, i'm trying create custom component animate list of objects in ngfor
loop.
here code component.
import { component, trigger, keyframes, animate, transition, style, ngzone } '@angular/core'; @component({ selector: 'animation-target', templateurl: 'animation-target.html', animations: [ trigger('zoomin', [ transition('inactive => active', animate(1000, keyframes([ style({ transform: 'opacity(0) scale3d(.3, .3, .3);', offset: 0 }), style({ transform: 'opacity(1)', offset: .50 }), ]))), ]) ] }) export class animationtarget { title = 'app works!'; public zoomstate: string; constructor(public zone: ngzone) { } triggeranimation() { this.zoomstate = "active"; } reset() { this.zone.run(() => { this.zoomstate = "inactive"; }); } }
here component html:
<animation-target [@zoomin]="zoomstate" (@zoomin.done)="reset()"></animation-target>
here i'm attempting use component:
<ion-item *ngfor="let event of gameevents" text-wrap> <h2 *ngif="event.category" animation-target [ngclass]="{'header-main': event.challenger, 'header-primary': !event.challenger }">{{event.category}} - {{event.time}} minutes: {{event.instigator}} {{event.description}}</h2> </ion-item>
here css zoomin animation being stored in app.scss:
@keyframes zoomin { { opacity: 0; transform: scale3d(.3, .3, .3); } 50% { opacity: 1; } } .zoomin { animation-name: zoomin; }
currently when go build app following output , error , i'm unsure i'm missing.
[10:03:58] ionic-app-scripts 0.0.38 [10:03:58] build prod started ... [10:03:58] clean started ... [10:03:58] clean finished in 19 ms [10:03:58] copy started ... [10:03:58] ngc started ... [10:03:59] copy finished in 1.34 s [10:04:00] lint started ... [10:04:08] lint finished in 8.07 s [10:05:04] error: error @ d:/app_rc0/app/.tmp/components/animation-target/animation-target.ngfactory.ts:104:45 [10:05:04] supplied parameters not match signature of call target. [10:05:04] ngc failed [10:05:04] ionic-app-script task: "build" [10:05:04] error: error npm err! windows_nt 10.0.14393 npm err! argv "c:\\program files (x86)\\nodejs\\node.exe" "c:\\users\\user\\appdata\\roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" npm err! node v6.7.0 npm err! npm v3.10.9 npm err! code elifecycle npm err! app@ build: `ionic-app-scripts build` npm err! exit status 1 npm err! npm err! failed @ app@ build script 'ionic-app-scripts build'. npm err! make sure have latest version of node.js , npm installed. npm err! if do, problem app package, npm err! not npm itself. npm err! tell author fails on system: npm err! ionic-app-scripts build npm err! can information on how open issue project with: npm err! npm bugs app npm err! or if isn't available, can info via: npm err! npm owner ls app npm err! there additional logging output above. npm err! please include following file support request: npm err! d:\app_rc0\app\npm-debug.log caught exception: undefined
any appreciated i'm still new ionic 2 , angular 2 , newer animations in angular 2.
Comments
Post a Comment