ic-trigger-delay - The Trigger Delay Attribute

Summary

The ic-trigger-delay attribute tells Intercooler to delay the firing of a request in response to a trigger until the specified time interval has passed. If the trigger occurs again before the interval is complete, the earlier trigger will cancel and new trigger will begin waiting for the specified interval.

Syntax

The value of the attribute should a valid integer, followed by the string "s" (for seconds) or "ms" (for milliseconds). (e.g. ic-trigger-delay="100ms" indicates intercooler will delay firing the request for 100 milliseconds after the trigger has occurred.)

Dependencies

ic-trigger-delay has no dependency implications.

Simple Example

Here is a text box that updates a div with its content after a delay:

  <input type="text" name="text"
         ic-post-to="/text" ic-trigger-on="keypress" ic-trigger-delay="500ms"
         ic-target="#text-div" ic-indicator="#indicator"/>
  <i id="indicator" class="fa fa-spinner fa-spin" style="display:none"></i>
  <br/>
  Text: <div id="text-div"></div>

Text: