This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable, Inject, Optional, Type} from '@angular/core'; | |
import {HammerGestureConfig} from '@angular/platform-browser'; | |
import {MAT_HAMMER_OPTIONS} from '@angular/material/core'; | |
/** | |
* Noop hammer instance that is used when an instance is requested, but | |
* Hammer has not been loaded on the page yet. | |
*/ | |
const noopHammerInstance = { | |
on: () => {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="product-expanded-details col-5 col-lg-6" *ngIf="(_mode === 'expanded')"> | |
<!-- Conditional template Outlet (see: https://stackoverflow.com/a/52448001/1116959) --> | |
<ng-container *ngTemplateOutlet="_product?.highlighted ? highlightedDetails : normalDetails; context: { product: _product }"> | |
</ng-container> | |
</div> | |
</div> | |
<!-- Product - Normal Details template --> | |
<ng-template #normalDetails let-product="product"> | |
<div class="variant-details" *ngIf="product?.type === 'single' || product?.type === 'multi'"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See: https://www.learnrxjs.io/operators/combination/forkjoin.html | |
// Added take(1) bc of this behaviour: https://github.com/angular/angularfire2/issues/617#issuecomment-255513958 | |
forkJoin( | |
this.firebaseService.getUserEventsForDevice(selectedDevice.key, filterCriteria).pipe(take(1)), | |
this.firebaseService.getEventsFromDevice(selectedDevice.key, filterCriteria).pipe(take(1)) | |
) | |
.subscribe( | |
([userEvents, deviceEvents]) => { | |
console.log('userEvents', userEvents); | |
console.log('deviceEvents', deviceEvents); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
app = express(); | |
app.use(express.static('dist/browser')); | |
// CORS (Cross-Origin Resource Sharing) headers to support Cross-site HTTP requests | |
app.all('*', function(req, res, next) { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header("Access-Control-Allow-Headers", "X-Requested-With"); | |
next(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "mobile-ui-design-client", | |
"version": "1.0.0", | |
"description": "A simple starter Angular2 project", | |
"scripts": { | |
"build": "rimraf dist && webpack --progress", | |
"watch": "npm run build -- --watch", | |
"server": "webpack-dev-server --inline --progress --port 3000 --content-base src", | |
"start-dev": "npm run server", | |
"prestart": "npm run build", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----> Fetching custom git buildpack... done | |
-----> Node.js app detected | |
PRO TIP: Specify a node version in package.json | |
See https://devcenter.heroku.com/articles/nodejs-support | |
-----> Defaulting to latest stable node: 0.12.2 | |
-----> Downloading and installing node | |
-----> Installing StrongLoop dependencies | |
> [email protected] install /tmp/build_a8813eae17f467f38dea32f9e4790273/vendor/node/lib/node_modules/strongloop/node_modules/strong-supervisor/node_modules/heapdump | |
> node-gyp rebuild | |
make: Entering directory `/tmp/build_a8813eae17f467f38dea32f9e4790273/vendor/node/lib/node_modules/strongloop/node_modules/strong-supervisor/node_modules/heapdump/build' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prerequisites | |
- Fisrt install protractor following this tutorial: https://github.com/angular/protractor/blob/master/docs/tutorial.md | |
- Then follow this tutorial to get things going: http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html | |
- After installing protractor, we configure Grunt. For that we have to do the following: | |
- npm install | |
- grunt | |
- And if we want to run the test, just run: grunt test (o grunt test:midway) | |
# How and what to test? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"type" : "add", | |
"id" : "AA0001", | |
"version": 1, | |
"lang": "es", | |
"fields" : { | |
"product_id": 1, | |
"variant_id": 11, | |
"title": "Quilt Real Patchwork de microfibra Amarelo. Modelo Rio de Janeiro. Varios tamaños a elección", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Faceted Search | |
Faceted search takes the documents matched by a query and generates counts for various properties or categories. Links are usually provided that allows users to "drill down" or refine their search results based on the returned categories. | |
The following example searches for all documents (*:*) and requests counts by the category field cat. | |
...&q=*:*&facet=true&facet.field=cat | |
Notice that although only the first 10 documents are returned in the results list, the facet counts generated are for the complete set of documents that match the query. |
NewerOlder