carrotquest.d.ts
onblur="carrotquest.identify({'$email': this.phone}); console.log(carrotquest.identify({'$email':this.phone }));"
phoneValid(e) {
this.phone = e.target.value
if(this.phone.length < 1) {
return this.phone = undefined
}
var carrotquest: any;
document.querySelector('#phoneFormAfterCal').addEventListener('blur', function () {
carrotquest.identify({'$phone': this.value})
console.log(carrotquest.identify({'$phone': this.value}))
})
}
function runOncePerDayUnsplash() {
if (!hasOneDayPassedUnsplash()) return false;
function renderGalleryItem(randomNumber) {
let selectionItem = []
fetch(`https://source.unsplash.com/collection/${collectionID}/${imageWidth}x${imageHeight}/?sig=${randomNumber}`)
.then((data) => {
localStorage.setItem('unsplashWall', data.url)
selectionItem.push(data.url)
})
// selectionItem.push(data.url)
// localStorage.setItem('selectionItem', JSON.stringify(selectionItem))
if ('FirstOpen' in localStorage) {
document.querySelector('#main').style.backgroundImage = 'url(' + './welcomeInstant.jpg' + ')';
} else {
if ('NopeRandomBg' in localStorage) {
document.querySelector('#main').style.backgroundImage = 'url(' + localStorage.getItem('bgImg') + ')';
} else {
localStorage.bgImg = localStorage.unsplashWall;
document.querySelector('#main').style.backgroundImage = 'url(' + localStorage.getItem('unsplashWall') + ')';
}
}
}
for (let i = 0; i < numItemsToGenerate; i++) {
let randomImageIndex = Math.floor(Math.random() * numImagesAvailable);
renderGalleryItem(randomImageIndex);
}
}
fetch(`https://source.unsplash.com/collection/${collectionID}/${imageWidth}x${imageHeight}/?sig=${randomNumber}`)
let selectionItem = []
.then((data) => {
localStorage.setItem('unsplashWall', data.url)
selectionItem.push(data.url)
localStorage.setItem('selectionItem', JSON.stringify(selectionItem))
})
let selectionItem = []
fetch(`https://source.unsplash.com/collection/${collectionID}/${imageWidth}x${imageHeight}/?sig=${randomNumber}`)
.then((data) => {
localStorage.setItem('unsplashWall', data.url)
selectionItem.push(data.url)
localStorage.setItem('selectionItem', JSON.stringify(selectionItem))
})
let randomBooleanItemFour = Math.random() > 0.5
let randomBooleanItemFour_two = Math.random() > 0.5
let randomBooleanItemFour_three = Math.random() > 0.5
let randomBooleanItemFour_four = Math.random() > 0.5
let randomBooleanItemFour_five = Math.random() > 0.5
this.renderItemFour = randomBooleanItemFour
this.renderItemFour_second = randomBooleanItemFour_two
this.renderItemFour_three = randomBooleanItemFour_three
this.renderItemFour_four = randomBooleanItemFour_four
this.renderItemFour_five = randomBooleanItemFour_five
if (randomBooleanItemFour == randomBooleanItemFour_two && randomBooleanItemFour_three && randomBooleanItemFour_four && randomBooleanItemFour_five ) {
this.returnItemBoolianFour();
}
returnItemBoolian() {
let booleanItemOne = [true, false]
let randomBooleanItemOne = Math.floor(Math.random() * booleanItemOne.length);
let boolean = [true, false]
let randomBoolean = Math.floor(Math.random() * boolean.length);
let booleanItemThree = [true, false]
let randomBooleanItemThree = Math.floor(Math.random() * booleanItemThree.length);
this.renderItemOne = randomBooleanItemOne
this.renderItemOne_second = randomBoolean
this.renderItemOne_three = randomBooleanItemThree
// randomBoolean == randomBooleanItemOne ? this.returnItemBoolian() : false
if (randomBoolean == randomBooleanItemOne && randomBooleanItemOne == randomBooleanItemThree) {
this.returnItemBoolian();
}
}
returnItemBoolian() {
let booleanItemOne = [true, false]
let randomBooleanItemOne = Math.floor(Math.random() * booleanItemOne.length);
let boolean = [true, false]
let randomBoolean = Math.floor(Math.random() * boolean.length);
let booleanItemThree = [true, false]
let randomBooleanItemThree = Math.floor(Math.random() * booleanItemThree.length);
this.renderItemOne = randomBooleanItemOne
this.renderItemOne_second = randomBoolean
this.renderItemOne_three = randomBooleanItemThree
// randomBoolean == randomBooleanItemOne ? this.returnItemBoolian() : false
if (randomBoolean == randomBooleanItemOne && randomBooleanItemOne == randomBooleanItemThree) {
this.returnItemBoolian();
}
}
<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(xXXXXX, "init", {
id: XXXXXXX,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
</script>
@Component({
selector: 'app-device',
templateUrl: './device.html'
})
class DeviceComponent {}
Вот где emit