JavaScript code cleanup

This commit is contained in:
Davide Alberani 2015-03-21 15:45:40 +01:00
parent bd5e73f62b
commit c63124f575
5 changed files with 111 additions and 109 deletions

View file

@ -1,5 +1,5 @@
<div class="container-fluid"> <div class="container-fluid">
<form ng-model="eventdetails" ng-submit="save()"> <form ng-model="eventdetails" ng-submit="save()">
<div class="input-group input-group-lg"> <div class="input-group input-group-lg">
<span class="input-group-addon" id="basic-addon1">Title</span> <span class="input-group-addon" id="basic-addon1">Title</span>
<input type="text" class="form-control" placeholder="Title" aria-describedby="basic-addon-2" value="{{event.title}}" ng-model="event.title" ng-required="1"> <input type="text" class="form-control" placeholder="Title" aria-describedby="basic-addon-2" value="{{event.title}}" ng-model="event.title" ng-required="1">
@ -20,5 +20,5 @@
<input type="text" class="form-control" placeholder="Date and time" aria-describedby="basic-addon1" value="{{event['end-datetime']}}" ng-model="event['begin-endtime']"> <input type="text" class="form-control" placeholder="Date and time" aria-describedby="basic-addon1" value="{{event['end-datetime']}}" ng-model="event['begin-endtime']">
</div> </div>
<input type="submit" style="position: absolute; left: -9999px; width: 1px; height: 1px;"/> <input type="submit" style="position: absolute; left: -9999px; width: 1px; height: 1px;"/>
</form> </form>
</div> </div>

View file

@ -4,6 +4,7 @@ var eventManApp = angular.module('eventManApp', [
'eventManControllers' 'eventManControllers'
]); ]);
eventManApp.directive('ngEnter', function () { eventManApp.directive('ngEnter', function () {
return function (scope, element, attrs) { return function (scope, element, attrs) {
element.bind("keydown keypress", function (event) { element.bind("keydown keypress", function (event) {
@ -17,6 +18,7 @@ eventManApp.directive('ngEnter', function () {
}; };
}); });
eventManApp.config(['$routeProvider', eventManApp.config(['$routeProvider',
function($routeProvider) { function($routeProvider) {
$routeProvider. $routeProvider.