Thanks Fred, that's definitely useful! And thanks for the prompt reply.
One other query, if you don't mind:
I'm trying to get a discharge button functioning. So far I have:
- Added the a discharge.js file to my static folder, containing:
controllers.controller(
'DischargeCtrl',
function($scope, $modalInstance, episode){
$scope.episode = episode;
$scope.dischargePatient = function(){
var ep = $scope.episode.makeCopy();
ep.end = new Date();
to_save.push($scope.episode.save(ep));
}
$scope.cancel = function() {
$modalInstance.close('cancel');
};
});
- Edited _init_.py to include my JS file
- Added a button to my inpatient.html file, with an ng_click call to my dischargePatient function
<button ng-click="dischargePatient()" class="btn btn-primary btn-lg">
<i class="fa fa-home"></i>
<span ng-show="episode.end">Confirm</span>
Discharge
</button>
However, the button doesn't seem to respond, or produce even an error message. This makes me think my JS file is not being recognised - could you possibly tell me what I am missing here?
Thanks again