Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

When trying to use an additionalTemplate it fails #78

Open
windbender opened this issue Jan 6, 2017 · 1 comment
Open

When trying to use an additionalTemplate it fails #78

windbender opened this issue Jan 6, 2017 · 1 comment

Comments

@windbender
Copy link

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 added a commit to windbender/angular-confirm that referenced this issue Jan 6, 2017
The solution is to check for true values
@decherneyge
Copy link

decherneyge commented Feb 22, 2017

+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})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants