javascript - Peer.js on-event and angular js -
i new angularjs peer.js too. working on small webrtc-application weekend project. able @ have build connection, function or rather binding:
peer.on('open', function(id) { console.log('my peer id is: ' + id); console.log("127.0.0.1/webrtc" + document.location.pathname + addurlparam(document.location.search, "id", id)); });
right sending url creating console, of course rather display somewhere useful. question is, how angularjs. coming jquery , like:
$("#myelement").html(id);
but since want learn angularjs wondering how it?
angular jquery-driven dom manipulations embeds @ least jquery lite
from angular doc
if jquery available, angular.element alias jquery function. if jquery not available, angular.element delegates angular's built-in subset of jquery, called "jquery lite" or "jqlite."
if loaded jquery (as you, stiller_leser, stated in comment), able use
angular.element("#myelement").html(id);
here doc angular element methods
if not, jqlite, use
angular.element( document.queryselector( '#some-id' ) );
Comments
Post a Comment