You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Rename main file to ng-navigation-service so it matches the package
name.
* Update to README for better explanation of dependency on
ng-authentication-service.
* Update version to 1.0.0.
The ng-navigation-service was designed in tandem with the ng-authentication-service, but it is not a hard requirement. The configured security service must support the following API:
15
+
16
+
1.```boolean isAuthenticated()```
17
+
2.```[String] roles()```
12
18
13
19
##Basic Setup
14
20
15
-
1.Add this module to your app as a dependency:
21
+
Add this module to your app as a dependency:
16
22
```JAVASCRIPT
17
23
var app =angular.module('yourApp', ['navigation.service']);
18
24
```
19
-
2. Configure a security service to use with the navigation provider:
25
+
26
+
Configure a security service to use with the navigation provider:
20
27
```JAVASCRIPT
21
28
app.config(['$navigationProvider', function ($navigationProvider) {
22
29
$navigationProvider.configure({
23
-
securityService:'authentication.service'
30
+
securityService:'$authentication'
24
31
});
25
32
}]);
26
33
```
27
-
3. Inject $navigation as a parameter in declarations that require it:
34
+
35
+
Inject $navigation as a parameter in declarations that require it:
To override the default configuration options, configure the module with an options argument during application configuration and provide overrides for any of the following options.
35
43
36
-
1. securityService: undefined - this string value must be provided during configuration and must be a loaded service that supports the following API:
37
-
1. function ```isAuthenticated()```
38
-
2. function ```roles()```
39
-
2. roleToAudienceMapFunction: function returns the userRole provided.
40
-
3. inAudienceValidationFunction: function determines if the userRoles are in the audiences.
41
-
4. activeLinkDecorator: mixed
42
-
5. inactiveLinkDecorator: mixed
43
-
44
-
To override the default configuration options, configure the module with an options argument during application configuration:
45
44
```JAVASCRIPT
46
45
app.config(['$navigationProvider', function ($navigationProvider) {
0 commit comments