![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ng-server-time
Advanced tools
Synchronizes local browser time with server time using clock synchronization algorithm, similar to NTP.
##Installation
Ensure angular, socket.io and ng-server-time are installed correctly
npm install socket.io
npm install angular
npm install ng-server-time
Ensure you have an angular socket.io factory such as this one, it is required by the server time factory:
app.factory('socket', function() {
var socket = io.connect();
return socket;
});
Include ng-server-time-factory.min.js
:
<script src="/socket.io.js"></script>
<script src="/angular.min.js"></script>
<script src="/ng-server-time-factory.min.js"></script>
<script src="/my-angular-app.js"></script>
Initilaize the socket on the server:
var server_time = require('ng-server-time');
io.sockets.on('connection', function (socket) {
server_time.init(socket);
});
###Usage
app.controller('MainController', function($scope, ServerTime){
// Date.now() on the server
$scope.now = ServerTime.now();
// new Date() on the server
$scope.new = ServerTime.new();
// get offset in milliseconds between current browser
// time and server time
$scope.getOffset = ServerTime.getOffset();
});
FAQs
Angular web socket implementation of network time protocol
The npm package ng-server-time receives a total of 3 weekly downloads. As such, ng-server-time popularity was classified as not popular.
We found that ng-server-time demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.