Skip to content

Instantly share code, notes, and snippets.

@toniesteves
Last active July 30, 2016 04:12
Show Gist options
  • Save toniesteves/fdea5835c3cc227a84675d722712872c to your computer and use it in GitHub Desktop.
Save toniesteves/fdea5835c3cc227a84675d722712872c to your computer and use it in GitHub Desktop.
app.controller('ModalCtrl', function ($scope, $http, ngDialog, Schedule,$controller) {
$scope.open = function (resourceObj,date) {
$scope.employee = resourceObj.title;
$scope.date = new Date(date);
$scope.time = new Date(date);
ngDialog.open({
template: '/assets/angular/views/modal',
controller: 'ScheduleCtrl',
cache: false,
className: 'ngdialog-theme-default ngdialog-theme-custom',
scope: $scope,
});
};
});
app.controller('ScheduleCtrl', function ($scope, $http, ngDialog, Schedule, $location) {
$scope.save = function(schedule) {
// Schedule.save({schedule:$scope.schedule});
// return $location.path('/schedules');
console.log(schedule.client, schedule.employee);
};
$scope.save1 = function() {
Schedule.update($scope.audience);
return $location.path('/schedules');
};
});
<div class="ngdialog-content">
<div class="ngdialog-message">
<h2>Agendamento de Horários</h2>
<form name="scheduleForm" novalidate>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputEmail1">Profissional:</label>
<input type="text" class="form-control" id="schedule_profissional" ng-model="employee" placeholder="Nome do Profissional" autocomplete="off" disabled>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputEmail1">Cliente:</label>
<input size="60" type="text" class="form-control" id="schedule_cliente"
ng-model="schedule.client" datasets="clientsData"
sf-typeahead placeholder="Nome do Profissional" autocomplete="off">
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label for="exampleInputEmail1">Data:</label>
<input type="text" class="form-control" id="schedule_data" ng-model="schedule.date" ng-value="date | date:'dd/MM/yyyy'" placeholder="Data" autocomplete="off" disabled>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="exampleInputEmail1">Horário:</label>
<input type="text" class="form-control" id="schedule_start" ng-model="schedule.time" ng-value="time | date:'HH:mm'" placeholder="Data de Inicio" autocomplete="off" disabled>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment