Skip to content

DanieleSassoli/AngularAdobeTypeKit

Repository files navigation

Angular Adobe Typekit

This module wants to provide an easy way to work with the Adobe TypeKit API's. All it does is call the appropriate endpoints and return the response provided by Adobe API's.

##Installation You can easily install the package via Bower:

bower install ngTypeKit

##Usage

After you include AngularJS you will need to include the script like.

<script src="/path/to/dist/build/ngTypeKit.js"></script>

Then inject it into your main module and provide your ApiKey

 angular.module('yourModule', ['ngTypeKit'])
       .config(['adobeTypeKitProvider', function(adobeTypeKitProvider){
           adobeTypeKitProvider.setApiKey(YOUR_API_KEY);
       }]);

Now you will be able to use the provided service like this

  yourApp.controller('YOUR_CONTROLLER', ['$scope', 'ngTypeKitService', function ($scope, ngTypeKitService) {
   ngTYpeKitService.getFamily(FAMILY_ID,function(err, data){
       if(!err) console.log(data);
       else console.log("error");
   });
  }]);

The service exposes the following methods, each one calls the corresponding endpoint of the TypeKit API's and returns the data as is, so I suggest you visit their [documentation] (https://typekit.com/docs/api) for an explanation of the returned data. Every method has a callback as last argument, which returns the error, if any, as first parameter, and the data, as second parameter.

##getFamily ###Docs params:

* familyId,
* callback

##getFamilyVariation ###Docs params:

* familyId,
* variationId,
* callback

##getKits ###Docs params:

* callback

##getKit ###Docs params:

* kitId,
* callback

##createKit ###Docs params:

* options, you can see an example object in the Adobe Documentation, or in my example
* callback

##updateKit ###Docs params:

* kitId,
* options
* callback

##deleteKit ###Docs params:

* kitId,
* callback

##getKitFamily ###Docs params:

* kitId
* familyId,
* callback

##updateKitFamily ###Docs params:

* kitId,
* familyId,
* callback

##deleteKitFamily ###Docs params:

* kitId,
* familyId,
* callback

##publishKit ###Docs params:

* kitId,
* callback

##publishedKit ###Docs params:

* kitId,
* callback

##getLibraries ###Docs params:

*libraries,
*callback

##getLibrary ###Docs params:

* libraryId,
* callback

About

AngularJS module to work with Adobe Typekit

Resources

License

Stars

Watchers

Forks

Packages

No packages published