Class RouteInfoWithAttributes

public
Defined in: packages/@ember/-internals/routing/lib/system/route-info.ts:1
Module: ember

find (callback, target*) Object public

Module: ember
callback
Function
the callback to execute
target*
Object
optional target to use
returns
Object
Found item or undefined

Allows you to traverse through the linked list of RouteInfos from the topmost to leafmost. Returns the first RouteInfo in the linked list for which the callback returns true.

This method is similar to the find() method defined in ECMAScript 2015.

The callback method you provide should have the following signature (all parameters are optional):

  function(item, index, array);
  • item is the current item in the iteration.

  • index is the current index in the iteration.

  • array is the array itself.

    It should return the true to include the item in the results, false otherwise.

    Note that in addition to a callback, you can also pass an optional target object that will be set as this on the context.

© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/3.25/classes/RouteInfoWithAttributes/methods