BlueSpire/Durandal — pull request #382 by gerrod (2013-11-11 03:10:31+00:00)
Title: Allow more granular control for module comparison during activation

Currently, Durandal's activator uses a simple equality check to determine if two modules are the same (during `canActivate`). Most of the time this is fine, but there are occasions where a child module needs more granular control to determine if two modules are indeed the same.

An example of this would be a wizard designed to create a new account. You hit "Step 1", and then decide to cancel that request. Later, you go back to "Step 1" with a different account; Durandal checks and says that the modules are indeed the same, and as such, the `canActivate` method is not invoked (even though the active account has changed, and as such, canActivate needed to run).

This change allows for modules to define a `isSameItem` method, which the activator will invoke if present, in order to determine if two modules are the same. Implementations may return a deferred or a boolean to indicate the result of the comparison. If the method is not implemented, the activator uses the default logic (equality comparison) to check if two modules are the same.