-
Notifications
You must be signed in to change notification settings - Fork 17
Home
Required files (relative to index.html):
- views/user/auth.html
- views/user/(any "name" instances of the .register method).html
.setBaseUrl(url);
Name | Type | Description |
---|---|---|
url | String | The base url to your Form.io account |
Example: https://(your unique Form.io project ID).form.io/
.setForceAuth(bool);
Name | Type | Description |
---|---|---|
bool | Boolean | Set to true if you would like the user to only have access to the login page until they are authenticated. Otherwise, set it to false. |
Example: FormioAuthProvider.setForceAuth(true);
.setStates(anonState, authState);
Name | Type | Description |
---|---|---|
anonState | String | The login state. Defaults to "login.auth". |
authState | String | The state the user is redirected to after login. Defaults to "home". |
Example: FormioAuthProvider.setStates('auth.login', 'home');
.register(name, resource, path);
Name | Type | Description |
---|---|---|
name | String | The name of your login template.
|
Example: FormioAuthProvider.register('login', 'user', 'login');
Name | Type | Description |
---|---|---|
event | String | The event. |
submission | Object | The result of the submission as a promise. |
This state contains the ng-formio-grid with all of the submissions. If you click the links inside the first column, it will take you to a tabbed template that will allow you to View/Edit/Delete that single submission.
Example: $state.go('exampleResourceIndex')
This state contains the submission that was clicked on and fired the rowView event. Now that access to the submission's id was given, the submission id must be passed in as a stateParam to the $state.go() method. The key in the stateParam method MUST be the name of the resource + "Id"
Example: #### $scope.$on('rowView', function(event, submission){ $state.go('exampleResource.view', {"exampleResourceId" : submission._id}) })
Example: #### $scope.$on('rowView', function(event, submission){ $state.go('exampleResource.edit', {"exampleResourceId" : submission._id}) })
Example: #### $scope.$on('rowView', function(event, submission){ $state.go('exampleResource.delete', {"exampleResourceId" : submission._id}) })