angular-digits

WebJar for angular-digits

Лицензия

Лицензия

MIT
Категории

Категории

Angular Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.webjars.bower
Идентификатор

Идентификатор

angular-digits
Последняя версия

Последняя версия

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

angular-digits
WebJar for angular-digits
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/ajwhite/angular-digits

Скачать angular-digits

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-digits/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-digits</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-digits/
implementation 'org.webjars.bower:angular-digits:1.0.2'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-digits/
implementation ("org.webjars.bower:angular-digits:1.0.2")
'org.webjars.bower:angular-digits:jar:1.0.2'
<dependency org="org.webjars.bower" name="angular-digits" rev="1.0.2">
  <artifact name="angular-digits" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-digits', version='1.0.2')
)
libraryDependencies += "org.webjars.bower" % "angular-digits" % "1.0.2"
[org.webjars.bower/angular-digits "1.0.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

angular-digits

This is an angular wrapper for twitter fabric's digits sdk. It bridges the gap between Angular's digest cycle and the foreign SDK by applying the asynchronous events to the digest cycle. It also provides convenient models to provide insight to the responses from the API (if the workflow was closed by the user, popup was blocked, etc).

Example usage

angular.module('app', ['atticoos.digits'])

.config(function (DigitsProvider) {
  // configure the provider before the application's run phase
  DigitsProvider.setConsumerKey('XXX');
})

.run(function (Digits) {
  var options = {
    accountFields: Digits.AccountFields.Email // Access Email Addresses
  };


  Digits.login(options).then(function (loginResponse) {
    // successfully logged in
  }).catch(function (error) {
    // a decorated error object describing the issue logging in
    if (error.wasPopupBlocked()) {
      // popup blocked
    } else if (error.wasWindowClosed()) {
      // user closed the window
    } else {
      // something else
    }
  });
});

Login Options

You can customize the Digits for Web sign in flow to collect user email addresses or pre-fill phone number information, based on your app’s needs.

For more informations go to Digits SDK Sign in Options Doc

Response Objects

This wrapper comes with some convenient models for better transparency of state and response information from the Digits SDK. It is suggested by the Digits SDK Docs that you securely verify the response data when logging in.

Login Response

Digits.login().then(function (loginResponse) { });

loginResponse.getOAuthHeaders()

Returns: Object

Returns the headers used to perform verification of the login response (X-Verify-Credentials-Authorization and X-Auth-Service-Provider)

{
  authorization: 'xx',
  url: 'https://xx'
}

Error Response

Digits.login().catch(function (loginError) { });

loginError.wasWindowClosed()

Returns: Boolean

Indicates if the workflow was aborted directly by the user closing the window before the process had completed

loginError.wasPopupBlocked()

Returns: Boolean

Indicates if the browser prevented the workflow by blocking the popup

loginError.type

The type attribute from the original response object

loginError.message

The message attribute from the original response object

Версии библиотеки

Версия
1.0.2