Skip to content

Instantly share code, notes, and snippets.

@reefstah
Last active April 14, 2016 16:05
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 reefstah/c6806820d41707e74f2682c5d979f709 to your computer and use it in GitHub Desktop.
Save reefstah/c6806820d41707e74f2682c5d979f709 to your computer and use it in GitHub Desktop.
import moment from 'moment';
import uiModules from 'ui/modules';
import uiRoutes from 'ui/routes';
import 'ui/autoload/styles';
import './less/main.less';
import template from './templates/index.html';
import 'leaflet';
import 'angular-simple-logger';
import 'ui-leaflet';
uiRoutes.enable();
uiRoutes
.when('/', {
template,
controller: 'exampleHelloWorld',
resolve: {
currentTime($http) {
return $http.get('../api/example/example').then(function (resp) {
return resp.data.time;
});
}
}
});
uiModules
.get('app/example', ['nemLogging', 'ui-leaflet'])
.controller('exampleHelloWorld', function ($scope, $route, $interval) {
$scope.defaults = {
tileLayer: 'http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png',
maxZoom: 14,
path: {
weight: 10,
color: '#800000',
opacity: 1
}
};
$scope.title = 'Example';
$scope.description = 'An awesome Kibana plugin';
var currentTime = moment($route.current.locals.currentTime);
$scope.currentTime = currentTime.format('HH:mm:ss');
$scope.currentTime = currentTime = '13:37:00';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment