1

My company has a set of reusable angular directives in a managed package. I want to use them in my app but it doesn't seem to be working. The directive in question is a datapicker. that looks like this:

(function(){
angular.module('nForceAngular.directives', [])
       .directive('nForceDatePicker',
   function(){

        return {
            link: function(scope, element, attrs){
                var options = {
                    'container': '.container-fluid',
                    'format': 'M d, yyyy',
                    'autoclose': true
                };

                if(attrs.format){
                    options.format = attrs.format;
                }

                jQuery(element).datepicker(options);
            }
        };
    }
);
}());

I include the directive (in a managed package called nFORCE) via

     <apex:includeScript value="{!URLFOR($Resource.nFORCE__angularCustomDirectives)}" />

My local angular module declares this as a dependency as

angular.module('paymentCalculatorApp', ['nForceAngular.directives']);

I then try to reference the directive via

<div nForceDatePicker="true"....

It works fine when the directive is included in the local module but not when it is in the managed package. I get no errors in the browser console and calling the jQuery function from the console causes it to work fine.

Any ideas?

0

You must log in to answer this question.

Browse other questions tagged .