I am facing an issue while trying to integrate the auth0.js library into my Angular2 rc1 TypeScript project for a custom signup feature. When I try to inject the auth0 library into my components, TypeScript throws a "Cannot find module 'auth0'" error.
Here is how you can configure it:
npm install auth0-js --save
typings install dt~auth0 --save --global
Code snippet from signupForm.component.ts:
import * as auth0 from "auth0-js"; //TypeScript: TS2307: Cannot find module 'auth0-js'
@Component({...})
export class SignupForm {
constructor(private auth:auth0){}
...
}
Code snippet from main.ts:
...
import * as auth0 from "auth0-js"; //TypeScript: TS2307: Cannot find module 'auth0-js'
bootstrap(..., [provide(auth0, { useFactory: () => {
return new auth0({...});
}})
]);