Skip to content

Instantly share code, notes, and snippets.

@ysyun
Last active April 14, 2017 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysyun/6c9667b9ef0120fb9ba00b3b91915cc2 to your computer and use it in GitHub Desktop.
Save ysyun/6c9667b9ef0120fb9ba00b3b91915cc2 to your computer and use it in GitHub Desktop.
Cordova Plugin Test for L1_angular_firebase_tuotrial
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
<p class="device-info"></p>
</div>
.event.device-info {
background-color: blue;
display: none;
}
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
if (device) {
console.log('> device', device);
var deviceInfoElement = parentElement.querySelector('.device-info');
deviceInfoElement.setAttribute('style', 'display:block;');
deviceInfoElement.innerHTML = 'Device Name: ' + device.name + '<br />' +
'Device Model: ' + device.model + '<br />' +
'Device Cordova: ' + device.cordova + '<br />' +
'Device Platform: ' + device.platform + '<br />' +
'Device UUID: ' + device.uuid + '<br />' +
'Device Version: ' + device.version + '<br />';
}
console.log('Received Event: ' + id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment