Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit cbf9637

Browse files
authored
fix(angular): Change to peerDependencies and allow Angular 2.0.0+
1 parent 5d33c1d commit cbf9637

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,24 @@ export class AppComponent extends AuthPortComponent {
5959
}
6060
```
6161

62+
If you're using a version of Angular < 2.3, extending AuthPortComponent won't work for you. As an alternative, you can inject the `Stormpath` service into your component, subscribe to `stormpath.user$` and implement `logout()` yourself.
63+
64+
```typescript
65+
import { Account, Stormpath } from 'angular-stormpath';
66+
...
67+
export class AppComponent {
68+
user$: Observable<Account | boolean>;
69+
70+
constructor(private stormpath: Stormpath) {
71+
this.user$ = this.stormpath.user$;
72+
}
73+
74+
logout(): void {
75+
this.stormpath.logout();
76+
}
77+
}
78+
```
79+
6280
You may also find it useful to view the [demo source](https://github.com/stormpath/stormpath-sdk-angular/blob/master/demo/app.component.ts).
6381

6482
### Configuration

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@
106106
"webpack-dev-server": "2.2.0",
107107
"zone.js": "^0.7.4"
108108
},
109-
"dependencies": {
110-
"@angular/core": "^2.4.0",
111-
"@angular/forms": "^2.4.0",
112-
"@angular/http": "^2.4.0",
109+
"peerDependencies": {
110+
"@angular/core": "^2.0.0",
111+
"@angular/forms": "^2.0.0",
112+
"@angular/http": "^2.0.0",
113113
"rxjs": "^5.0.2",
114114
"ng2-webstorage": "1.4.3",
115115
"angular2-cookie": "^1.2.6"

0 commit comments

Comments
 (0)