angular-confirm
angular-confirm copied to clipboard
When trying to use an additionalTemplate it fails
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
+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})