angular-confirm icon indicating copy to clipboard operation
angular-confirm copied to clipboard

When trying to use an additionalTemplate it fails

Open windbender opened this issue 7 years ago • 1 comments

The code as it sits ends up deleting a template ( because it's trying to use templateUrl )

This is because the check which is supposed to confirm existence of templateUrl is code in correctly. Specifically line 63 checkout for 'templateUrl' in settings which returns true even if the field has a value of undefined. A more appropriate check would be just settings.templateUrl which will return false in the case of undefined

windbender avatar Jan 06 '17 21:01 windbender

+1

as a work around you can inject $confirmModalDefaults, along side $confirm, select the template, and set it on the settings object. $confirm( {text:'Confirm Delete',ok:'Yes Delete',cancel:'Cancel'} ,{template: $confirmModalDefaults.additionalTemplates['dangerTemplate'].template})

decherneyge avatar Feb 22 '17 20:02 decherneyge