How to setup aws s3 Javascript sdk in AngularSJ

I am trying to implement amazon s3 to store all my user uploaded images (I’m using http://ngcordova.com/docs/plugins/camera/). I already understand the part where you have to:

  1. create a bucket
  2. take note of the credentials
  3. install the javascript sdk

im got lost on configuring the sdk. and using the rest api to get/post data

I am using the aws sdk in a couple of projects. You simply need to set it up inside your app’s config block:

angular.module('myApp', [
    'myApp.filters',
    'myApp.services',
    'myApp.directives',
    'myApp.controllers',
    'myApp.plugins'
])
.config([function() {
        AWS.config.update({accessKeyId: 'your-access-key-id', secretAccessKey: 'your-secret-key'});  
 }]);

Then in your controller or service:

new AWS.S3().listObjects({Bucket: 'myBucket'}, function(error, data) {
	if (!error) {
		console.log(JSON.stringify(data))	
	}
});

Hope it helps!