Velocity API: WLEvent.exitScope()

Version 2

    Return To Index

    WLEvent.exitScope()

    Overview

    Exits a scope by removing it from the scope stack and then discarding the events associated with the scope. Triggers the “exitScope” event after event handlers from the current scope are removed.

    Added in version 1.2.0

    See Also
    • WLEvent.enterScope()

    Format

     

    var scopeExited = WLEvent.exitScope(scope);
    ParameterDescriptionTypeRequiredNotes
    scopeThe scope to exit.StringRequired
    scopeExitedThe return value. True if the scope was successfully exited.BooleanReturnReturns false if scope is “global”, otherwise returns true.

     

    Example

    /* Removes all event handlers for the "mySpecial" scope. 
    */
      
    WLEvent.exitScope("mySpecial");