Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var app = angular.module('Tag',['tagService','ngDialog','uicommons.common.error']);
- app.controller('tagCtrl',['$scope','TagService','ngDialog',
- function ($scope,TagService,ngDialog) {
- $scope.persionUuid='';
- $scope.setPersonUuid = function(uuid){
- $scope.persionUuid = uuid;
- }
- // then call data-ng-init="setPersonUuid ($id)" in the view
- function loadTags(personUuid) {
- var payload = {
- objectType: 'org.openmrs.Person',
- objectUuid: personUuid
- };
- TagService.getTags(payload).then(function (res) {
- $scope.tags = res;
- });
- };
- $scope.showDialog = function(tag, personUuid) {
- ngDialog.openConfirm({
- showClose: false,
- closeByEscape: true,
- closeByDocument: true,
- data: tag,
- template: 'dialogTemplate'
- }).then(function() {
- TagService.deleteTag(tag).then(function (res) {
- loadTags(personUuid);
- })
- });
- };
- .......
- }
- when you are calling $scope.showDialog() pass the tag and ${ patient.patient.uuid }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement