- In
tsconfig.json
, set"target"
to"es6"
. - Add
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
in theNgModule
decorator of the Angular Module where your components will live. - Use Angular CLI to generate a component.
- Refactor generated Component's import statement, decorator, constructor, and add a render function as seen in the example below.
- Refactor the import statement of the Component in the parent Module from
import { HelloWorldComponent } from './hello-world/hello-world.component'
toimport './hello-world/hello-world.component'
This file contains 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 language = { | |
_numberOfTimesCalled: 0, | |
set foo(name) { | |
this._numberOfTimesCalled++ | |
this._foo = name | |
}, | |
get foo() { | |
return this._foo | |
} |
This file contains 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 yes_no = function() { | |
const possibilities = [ | |
[ | |
{ | |
"label": "yes", | |
"name": "1", | |
"value": "" | |
}, | |
{ | |
"label": "no", |
This file contains 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
shouldGridAutoStop() { | |
const firstXButtons = tangyToggleButtons.slice(0, this.autoStop) | |
const hasAtLeastOneUnpressedButton = firstXButtons | |
.reduce((hasAtLeastOne, button) => hasAtLeastOne || button.pressed === false ? true : false, false) | |
return hasAtLeastOneUnpressedButton ? false : true | |
} |
This file contains 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 foo = ` | |
Here is a debugger statment in a template... | |
${(()=>{ debugger })()} | |
` |
This file contains 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 message = 'Hello world' | |
var number = '555-555-5555' | |
var options = { | |
replaceLineBreaks: false, // true to replace \n by a new line, false by default | |
android: { | |
intent: 'INTENT' // send SMS with the native android SMS messaging | |
//intent: '' // send SMS without opening any other app | |
} | |
}; | |
var success = function () { alert('Message sent successfully'); }; |
This file contains 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
find . -type f | xargs -I $0 ls -ll --time-style=long-iso $0 | awk '{print $6" "$7" "$8}' | sort | grep -E '2019-[0[7-9]|1]' |
This file contains 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
// When viewing a form, the EventInstance's ID will be at position 5 in the URL hash. | |
const eventInstanceId = window.location.hash.split('/')[5] | |
// With the eventInstanceId, we can find the matching eventInstance in caseService.case.events. | |
const eventInstance = caseService.case.events.find(eventInstance => eventInstance.id === eventInstanceId) | |
// With the eventInstance handy, we can use the eventInstance.caseEventDefinitionId to find the EventDefinition inside of caseService.caseDefinition.eventDefinitions. | |
const eventDefinition = caseService.caseDefinition.eventDefinitions.find(eventDefinition => eventDefinition.id === eventInstance.caseEventDefinitionId) |
This file contains 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
TEST_ID=$(uuid) | |
echo "Running 100 with Test ID of $TEST_ID" | |
mkdir $TEST_ID | |
cd $TEST_ID | |
dat share & | |
sleep 5 | |
for i in {1..100} | |
do |
This file contains 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 sleep = (milliseconds) => new Promise((res) => setTimeout(() => res(true), milliseconds)) | |
const fillUpWithRevisions = async (numberOfDocs = 100, numberOfRevisionsPerDoc = 10, templateDoc, compactCompare = true, autoCompact = false, destroy = true) => { | |
let initialEstimate = await navigator.storage.estimate() | |
let dbName = `test-${new Date().getTime()}` | |
let db = new PouchDB(dbName, {auto_compaction: autoCompact}) | |
delete templateDoc._rev | |
let docNumber = 0 | |
let revisionNumber = 0 | |
while (numberOfDocs > docNumber) { |