-
Notifications
You must be signed in to change notification settings - Fork 196
Migrating to version 1.0.0 from 0.x
Several breaking changes were introduced upon the release of 1.0.0. These changes were made to improve the comprehension of the API and make it more concise, and also to ensure the ng-idle
module follows the best practices recommended by AngularJS.
The changes are categorized as follows.
The $
prefix to services were removed, as this practice is considered reserved for AngularJS services. The list below details the original name of the ng-idle
service in v0.x on the left, and the new name in 1.0.0 on the right:
-
$idle
->Idle
-
$idleProvider
->IdleProvider
-
$keepalive
->Keepalive
-
$keepaliveProvider
->KeepaliveProvider
With the exception of the renamed methods detailed below, the signatures of these services have largely remained the same. You should be able to simply search and replace $idle
with Idle
as well as $keepalive
with KeepAlive
throughout your application.
Some of the initial vocabulary for describing concepts was tentative, and as the module evolved became clearer. Because I'm picky, I decided to just clean these up:
-
idleDuration()
->idle()
-
warningDuration()
->timeout()
-
activeOn()
->interrupt()
The $
prefix was also removed from event names to remain consistent. Below are the renamed events.
-
$keepaliveResponse
->KeepaliveResponse
-
$idleStart
->IdleStart
-
$idleEnd
->IdleEnd
-
$idleWarn
->IdleWarn
-
$idleTimeout
->IdleTimeout
The event parameters have otherwise not changed. If you searched and replaced the service names as mentioned above, the event names will also likely also have been updated.
Dropped the ng-
prefix from directives.
-
ngIdleCountdown
->IdleCountdown
(HTML:ng-idle-countdown
->idle-countdown
)