Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

Commit

Permalink
chore(key guide): Adds a key and filter guide
Browse files Browse the repository at this point in the history
  • Loading branch information
cmac1212 committed Apr 10, 2014
1 parent f298fd4 commit fbd9472
Show file tree
Hide file tree
Showing 4 changed files with 426 additions and 6 deletions.
20 changes: 18 additions & 2 deletions docs/v1/examples/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ provider and the [$goUsers](../users.md) service.

The full source for this example can be found [here](https://github.com/colinmacdonald/goangular-auth-example).

## Table of Contents

1. [Install](#1.-install)
2. [Set up view](#2.-set-up-view)
3. [Configure GoAngular and set up routes](#3.-configure-goangular-and-set-up-routes)
4. [Permissions service](#4.-permissions-service)
5. [Main controller](#5.-main-controller)
6. [Access directive](#6.-access-directive)
7. [Set up menu and login buttons](#7.-set-up-menu-and-login-buttons)
8. [Views](#8.-views)

### 1. Install

First things first, we include all of our dependencies.
Expand Down Expand Up @@ -234,7 +245,7 @@ app.directive('access', function($goConnection, permissions) {
});
```

### 7. Set up the menu and login buttons
### 7. Set up menu and login buttons

Time to get back to the view and put our new `access` directive to good use.

Expand Down Expand Up @@ -276,7 +287,7 @@ model using the `$local` property to display their name.
</div>
```

### 8. Add the views
### 8. Views

We defined our routes in **Step 3**, now lets add the corresponding views.

Expand Down Expand Up @@ -324,8 +335,13 @@ id, and email (if available).
</div>
```

### Conclusion

That's it! We created an app that handles both authentication and user
permissions without any back-end set up. To test the how the `/profile` route
permissions work, try navigating to `/profile` directly in the browser. As a
guest user the link to that view will not be displayed, instead you will be
redirected to the `restricted` view.

Using the concepts covered in this example you are now ready to start writing
your own GoAngular app using [$goUsers](../users.md) and auth with [$goConnection](../connection.md).
2 changes: 1 addition & 1 deletion docs/v1/examples/hierarchy.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ "__root", "auth" ]
[ "__root", "key", "auth" ]
5 changes: 2 additions & 3 deletions docs/v1/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ Each example will walk you through building a simple app based on a specific
GoAngular concept or feature. Included with the example is a link to the source
code, which you can download and run yourself.

1. [Users and Authentication](./auth.md)

More Examples coming soon!
1. [Key Models and Filtering](./key.md)
2. [Users and Authentication](./auth.md)
Loading

0 comments on commit fbd9472

Please sign in to comment.