Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- his.dataProvider.getProducts().subscribe((products) => {
- this.products = products;
- //Pull an Array of ASINs from Firebase Database
- this.products.forEach(product => {
- this.asins.push(product.ASIN)
- this.productKey.push(product.$key)
- //console.log(this.productKey.toString());
- var lastASIN = this.productKey.pop();
- console.log (lastASIN);
- return this.dataProvider.getNextProducts(lastASIN).subscribe((products) => {
- this.products.forEach(product => {
- this.asins.push(product.ASIN)
- this.productKey.push(product.$key)
- var newASIN = this.productKey.pop();
- console.log (newASIN);
- })
- })
- });
- import 'rxjs/add/operator/take';
- import 'rxjs/add/operator/skip';
- this.dataProvider.getNextProducts(lastASIN).skip(numToSkip).take(10).subscribe(...
- new Firebase("https://examples-sql-queries.firebaseio.com/widget")
- .startAt(null, lastWidgetOnPrevPage)
- .limitToFirst(LIMIT+1) // add one to limit to account for lastWidgetOnPrevPage
- .once('value', function(snap) {
- var vals = snap.val()||{};
- delete vals[lastWidgetOnPrevPage]; // delete the extraneous record
- console.log('widgets on this page', vals);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement