Topic: Interpolation and data-wow-delay attribute not working
data-wow-delay="{{delay[0]}}"I can assign this property value to any other attribute and it works fine. This is very basic, so I'm really confused as to why this is not working. The wow animations work fine within my project, so I know that it is all configured correctly. The end goal is to use an *ngFor as shown below on a <div> and animate a string of text letter by letter, so I'd change the zero (below) to an i when referencing the "delay" array below.
<div class="container"> <div class="row text-center text-uppercase pt-5"> <div class="col-12"> <div *ngFor="let titles of title; let i = index" class="h1 d-inline wow zoomIn"data-wow-delay="{{delay[0]}}">{{title[i]}} </div> </div> </div> </div>The component.ts related to this component has the following property...
delay: string[] = ['0.7s', '1.7s', '2.7s'];Nothing complicated here at all yet {{delay[0]}} renders nothing when assigned to data-wow-delay, yet it returns '0.7s' when assigned to any other attribute for testing purposes. I hope that makes sense and someone can clear this up for me. Thank you, John
Damian Gemza staff answered 7 years ago
[attr.data-error]="delay"
delay: string = '3.0s';
johndev pro answered 7 years ago
<div class="h1 wow zoomIn" [data-wow-delay]="delay">Testing</div>TS
delay: string = "2.7s";
Damian Gemza staff answered 7 years ago
[attr.data-wow-delay]instead of traditional binding
[data-wow-delay].So this code will work:
<div class="h1 wow zoomIn" [attr.data-wow-delay]="delay">Testing</div>And this code won't work to you:
<div class="h1 wow zoomIn" [data-wow-delay]="delay">Testing</div>And delay is:
delay: string = "2.7s";
rajeshweb answered 6 years ago
Damian Gemza staff answered 6 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: Yes
- Provided link: No