0.20.4 • Published 5 years ago
@signatu/consent-angularjs v0.20.4
AngularJS components for Signatu Consent
This library contains AngularJS (aka Angular version 1)client components for Signatu Consent. It depends on the Signatu service, and the library interacts with signatu.com
.
Installation
npm
npm install @signatu/consent-angularjs
Usage
The library contains the following components:
consent-buttons
: consent request component using buttons.consent-checkbox
: consent request component using checkbox.data-processing-consent
: consent component for data processing specification data - e.g., from a Privacy Policy generated with Signatu.policy-consent-dashboard
: consent component to generate a dashboard of all (or subset) of consent targets in a signatu Privacy Policy.
Properties
ES6
import angular from 'angular'
import ConsentModule from '@signatu/consent-angularjs'
angular.module('myApp', [ConsentModule.name])
.controller('myCtrl', function($scope) {
$scope.consentConfig = {
apiKey: 'MY_API_KEY',
accessToken: 'MY_ACCESS_TOKEN'
};
$scope.title = "Privacy Dashboard";
$scope.subtitle = "Read our Privacy Policy";
$scope.subject = MY_SUBJECT_ID;
$scope.handleConsentEvent = function(event) {
console.log("Got new consent event: ", event)
}
})
})
Now you can use the components in your HTML:
<policy-consent-dashboard
config="consentConfig"
title="title"
subtitle="subtitle"
subject="subject"
policy-url="'https://signatu.com/api/v0/policies/118'"
element-ids="['4.2', '4.3']"
on-consent="handleConsentEvent">
</policy-consent-dashboard>
Typescript
Basically the same as for ES6, except you have types for the Config:
import * as angular from 'angular'
import ConsentModule, {ConsentConfig} from '@signatu/consent-angularjs'
const config: ConsentConfig = {
apiKey: 'MY_API_KEY',
accessToken: 'MY_ACCESS_TOKEN'
}
...
Further information
Go to signatu.com or send us an email on support@signatu.com.
License
This library is MIT Licensed.