0
votes

I am trying to call angular directive from meteor to display intuit button. I have tried using the quickbook button directly in meteor, but it didn't work as it did not allow me to display the button in the area of my choice. Hence this route .

The directive is defined in a js file in the following way

if (Meteor.isClient) {
console.log("Yes Client"); 
angular.module('connectIntuitAngular',['angular-meteor'])
.directive('connectToQuickbooks', function($window){
 return {
            restrict: 'E',
            template: '<ipp:connectToIntuit></ipp:connectToIntuit>',
            link: function(scope) {
                var script = $window.document.createElement("script");
                script.type = "text/javascript";
                script.src = "https://appcenter.intuit.com/Content/IA/intuit.ipp.anywhere-1.3.3.js";
                script.onload = function () {
                    console.log("On Load Called");
                    scope.$emit('intuitjs:loaded');
                };
                $window.document.body.appendChild(script);
                scope.$on('intuitjs:loaded', function (evt) {
                    $window.intuit.ipp.anywhere.setup({ grantUrl: '/' });
                    scope.connected = true;
                    scope.$apply();
                });
            }
        }
    });

}

I try to use this directive in a meteor template in the following way , but the button doesn't show, rest of the components in the template shows.

<div ng-app="connectIntuitAngular">
<connect-to-quickbooks></connect-to-quickbooks>
</div>

The same code works when I try it in plain angular, alsoI have the meteor angular package(urigo:angular) included.

1

1 Answers

0
votes

Change

angular.module('connectIntuitAngular',['angular-meteor'])

to

angular.module('connectIntuitAngular')

It might work. Every time angular.module is called you don't need to include other modules.