You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Directive being tested using the standard lineman angular template:
.directive('dlErrorValidationHandlerHelper',['DLValidationService','$templateCache',function(DLValidationService,$templateCache){return{scope: true,// I was not able to make this work with the unit tests; temnplate below did the work.//templateUrl: function(tElement, tAttributes) {// var validationType,// validationDefinitionObject,// templateUrl;//// if(!tAttributes.hasOwnProperty('validationType')) {// throw "dlValidationDirective requires attribute: validationType";// }// validationType = tAttributes.validationType;//// validationDefinitionObject = DLValidationService.getVDO(validationType);// if(validationDefinitionObject === null) {// throw "dlValidationDirective unable to find validation definition object for: " + validationType;// }// templateUrl = validationDefinitionObject.templateUrl;// var templateUrlString = $templateCache.get(templateUrl);//// console.log("templateUrl: " + templateUrl);// console.log("templateUrlString: " + templateUrlString);// return templateUrl;//},template: function(tElement,tAttributes){varvalidationType,validationDefinitionObject,templateUrl;if(!tAttributes.hasOwnProperty('validationType')){throw"dlErrorValidationHandlerHelper requires attribute: validationType";}validationType=tAttributes.validationType;validationDefinitionObject=DLValidationService.getVDO(validationType);if(validationDefinitionObject===null){throw"dlErrorValidationHandlerHelper unable to find validation definition object for: "+validationType;}templateUrl=validationDefinitionObject.templateUrl;vartemplateUrlString=$templateCache.get(templateUrl);//console.log("templateUrl: " + templateUrl);//console.log("templateUrlString: " + templateUrlString);returntemplateUrlString;},controller: function($scope,$element,$attrs,$transclude){},compile: function(){return{pre: function(scope,tElement,tAttributes){},post: function(scope,iElement,iAttributes){//console.log("dlErrorValidationHandlerHelper_post: I was here");scope.validationArgument=null;if(iAttributes.hasOwnProperty('validationArgument')){scope.validationArgument=iAttributes.validationArgument;}}};}};}])
Observed behavior
It does not work when using templateUrl. Note that the code is commented out.
It works when using template in combination with _$templateCache.get().
Expected Behavior
It works with templateUrl
I found references about how to use _ ng-html2js_ with Karma, but was not able to find similar documentation about how to configure TESTEM to use it. I suspect that it is there and that I missed it completely.
Regardless, thanks in advance for your help with this.
Regards
Rodrigo
The text was updated successfully, but these errors were encountered:
Hi Rodrigo, heads up that I don't have much of an idea of how to fix this nor whether it's lineman or testem's responsibility to do so. We don't need this particular feature ourselves, so we're not likely to address this problem, however we would be glad to accept a tested pull request if it resolves the issue without apparent unintended consequences.
Steps to reproduce
Observed behavior
Expected Behavior
I found references about how to use _ ng-html2js_ with Karma, but was not able to find similar documentation about how to configure TESTEM to use it. I suspect that it is there and that I missed it completely.
Regardless, thanks in advance for your help with this.
Regards
Rodrigo
The text was updated successfully, but these errors were encountered: