import { async, ComponentFixtureAutoDetect, TestBed } from '@angular/core/testing';
describe('NguiVirtualListComponent', () => {
...
beforeEach(async(() => {
TestBed.configureTestingModule({
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
| function fireEvent(el, type, options) { | |
| var event; | |
| if (type === 'click' || type.match(/^mouse/)) { | |
| event = new MouseEvent(type, options); | |
| } else if (type.match(/^key/)) { | |
| event = new KeyboardEvent(type, options); | |
| } else if (type.match(/^touch/)) { | |
| event = new TouchEvent(type, options); | |
| } | |
| el.dispatchEvent(event); |
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 webpack = require('webpack'); | |
| var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| var path = require('path'); | |
| var folders = { | |
| APP: path.resolve(__dirname, '../app'), | |
| BUILD: path.resolve(__dirname, '../build'), | |
| BOWER: path.resolve(__dirname, '../bower_components'), | |
| NPM: path.resolve(__dirname, '../node_modules') | |
| }; |
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
| # Cassandra storage config YAML | |
| # NOTE: | |
| # See http://wiki.apache.org/cassandra/StorageConfiguration for | |
| # full explanations of configuration directives | |
| # /NOTE | |
| # The name of the cluster. This is mainly used to prevent machines in | |
| # one logical cluster from joining another. | |
| cluster_name: 'Test Cluster' |
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
| const getClassName = function(obj) { | |
| if (obj.constructor.name) return obj.constructor.name; | |
| // Chrome "function HTMLButtonElement() { [native code] }" | |
| var funcMatch = obj.constructor.toString().match(/^\s*function\s*(\S+)\s*\(/); | |
| // IE11 "[object HTMLButtonElement]" | |
| var objMatch = obj.constructor.toString().match(/\[object\s(\S+)\]/); | |
| return objMatch ? objMatch[1] : funcMatch[1]; | |
| } |
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 dragDataTransfer = { | |
| data: {}, | |
| setData: function(type, value) { this.data[type] = value; }, | |
| getData: function(type) { return this.data[type] } | |
| }; | |
| function getDragDropEvent(type, dataTransfer) { | |
| var dragDropEvent = new DragEvent(type); | |
| console.log('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', dataTransfer); | |
| Object.defineProperty(dragDropEvent.constructor.prototype, 'dataTransfer', dataTransfer); |
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
| const getSortKey = function(el) { | |
| const pad = function(str, len) { | |
| return ('' + str + ' ').slice(0, len); | |
| }; | |
| const addr = [pad(el.streetName || '', 5), pad(el.streetNumber || '', 5), pad(el.unit || '', 5)].join(''); | |
| const name = [pad((el.firstName||'').toLowerCase(), 5), pad((el.lastName||'').toLowerCase(), 5)].join(''); | |
| if (el.product === 'wireless') { | |
| return [pad('', 15), name, el.ctn, '0-wls'].join(''); | |
| } else if (el.product === 'internet') { | |
| return [addr, pad('', 20), '1-hsi'].join(''); |
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
| export const timing = { | |
| 'linear': function(k) { | |
| return k; | |
| }, | |
| 'ease-in': function(k) { | |
| return Math.pow(k, 1.675); | |
| }, | |
| 'ease-out': function(k) { | |
| return 1 - Math.pow(1 - k, 1.675); | |
| }, |
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
| .bounce-in-left { | |
| animation: bounce-in-left 1.1s both; | |
| } | |
| @keyframes bounce-in-left { | |
| 0% { | |
| transform: translateX(-600px); | |
| animation-timing-function: ease-in; | |
| opacity: 0; | |
| } |
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
| // | |
| // https://blog.angularindepth.com/everything-you-need-to-know-about-debugging-angular-applications-d308ed8a51b4 | |
| // | |
| ng.probe($0).triggerEventHandler('click'); | |
| ng.probe($0).parent.nativeElement | |
| ng.probe($0).injector.get('MyService'); | |
| ng.probe($0).componentInstance.name; |