Book Image

AngularJS Web Application Development Blueprints

By : Vinci J Rufus
Book Image

AngularJS Web Application Development Blueprints

By: Vinci J Rufus

Overview of this book

Table of Contents (17 chapters)
AngularJS Web Application Development Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Integrating AWS JS SDK with our application


Now, we will integrate the AWS services with our application. Amazon has released a client-side SDK called AWS JS SDK. You can read more about it at http://aws.amazon.com/sdkforbrowser/.

We will be using this SDK to interact with our S3 bucket and DynamoDB table. We start by including the JS SDK file in our index.html file as follows:

  <script src="https://sdk.amazonaws.com/js/aws-sdk-2.0.0-rc.17.min.js"></script>

Next, we will create our provider service, which will contain all of the methods required for us to interact with the AWS SDK.

Creating the AWS service provider

The provider is a core type of recipe, and all other types such as factories and services are derived from the provider. The provider allows us to create additional methods that can be used to configure it.

Let's create our provider in our app/js/services.js file as follows:

.provider('AWSservice', [
        function() {

            var region, S3bucketName, dynamoTableName...