Skip to Main Content
AngularJS Web Application Development Blueprints
book

AngularJS Web Application Development Blueprints

by Vinci J Rufus
August 2014
Intermediate to advanced content levelIntermediate to advanced
300 pages
6h 9m
English
Packt Publishing
Content preview from AngularJS Web Application Development Blueprints

Creating our product details page

Next, we will build our product details page. We'll try this by writing out the factory service that will return the data for the selected product. Within the AWSservice provider, create the following function:

getProductDetails: function(id) {
    var d = $q.defer();

    var params = {
        'Key': {'product_id': {'S': id}
        }
    };
    dynamo.getItem(params, function(err, data) {
        if (err) $log.error('err= ' + err);
        if (data) {
            d.resolve(data);
        }
    });
    return d.promise;
},

The code will look familiar to you by now. We build the params object with the key parameter. Note that the key parameter always needs to be the hash value. In case you defined a RangeKey while creating your table, you will also need to set the RangeKey values while ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AngularJS: Maintaining Web Applications

AngularJS: Maintaining Web Applications

Rodrigo Branas, Chandermani, Matt Frisbie, Amos Q. Haviv
AngularJS

AngularJS

Shyam Seshadri, Brad Green
Professional AngularJS

Professional AngularJS

Valeri Karpov, Diego Netto
Pro AngularJS

Pro AngularJS

Adam Freeman

Publisher Resources

ISBN: 9781783285617Supplemental Content