Migrate to Angular-Token 7.x
The library has been renamed to Angular-Token and now includes Http Interceptor support. Please follow the steps below to upgrade from older versions.
1. Install new NPM package
The name of the npm has been changed as well. Please uninstall the older package and install the new one.
2. Change imports
Change all imports form 'angular2-token' to 'angular-token'. The module, service and models imported have been renamed as well. Removing the '2' in each name should do the trick.
Before:
After:
3. Change from Service import to Module import
Import AngularTokenModule
in your root module instead of providing Angular2TokenService
. Also remove the .init()
and provide the Angular2TokenOptions
via the .forRoot()
function.
Before:
After:
4. Update '.signIn()', '.register()' and '.resetPassword()' to use 'login' rather than 'email'.
To allow for more flexibility in the login, we changed the models to accept 'login' rather than 'email'.
Before:
After:
5. Use regular HttpClient calls
Replace all tokenService wrapper calls (get, post, put, delete, etc) with regular HttpClient calls.
Before:
After:
Last updated