Skip to content

Commit 239e229

Browse files
authored
Merge pull request #153 from Foxeye-Rinx/master
Update README.md due to angular component-based architecture
2 parents a080bb2 + b9048db commit 239e229

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ Almost all applications that implement authentication need some indication of wh
234234
<button ng-if="!isAuthenticated">Log In</button>
235235
<button ng-if="isAuthenticated">Log Out</button>
236236
```
237+
**Note:** `authManager` set `isAuthenticated` on your `$rootScope` object, If you are using component-based architecture,
238+
your component `$scope` is isolated scope, it does not inherits `$rootScope` properties, you need to access `$rootScope` from component's template:
239+
240+
```html
241+
<button ng-if="!$root.isAuthenticated">Log In</button>
242+
<button ng-if="$root.isAuthenticated">Log Out</button>
243+
```
237244
238245
### Getting Authentication State on Page Refresh
239246

0 commit comments

Comments
 (0)