Closed
Description
The error thrown is:
Error: Expected 1 or 4 constructor parameters.
This is coming from the Color
constructor. Looks like the property's valueConverter
is called from parseKeyframeDeclarations
with a value which is already a Color
instance, which is then passed into the Color
constructor, which in turn doesn't expect it and throws the error. In fact, this might be a core NativeScript issue, because valueConverter
expects a string.
This can be easily reproduced by running the following example, which throws as soon as it initializes as it transitions into the "inactive" state:
Or the following simplified testcase:
import { Component } from "@angular/core";
import { trigger, style, animate, state, transition } from "@angular/animations";
@Component({
selector: "animation-states",
template: `
<StackLayout>
<Button text="Touch me!" [@state]="isOn ? 'active' : 'inactive'" (tap)="onTap()"></Button>
</StackLayout>`,
animations: [
trigger("state", [
state("active", style({
backgroundColor: "green"
})),
transition("* => active", [ animate("600ms ease-out") ])
])
]
})
export class AppComponent {
isOn = false;
onTap() {
this.isOn = !this.isOn;
}
}
Metadata
Metadata
Assignees
Labels
No labels