CrossLead / angular-zendesk-widget

Angular wrapper for the Zendesk Web Widget
Apache License 2.0
18 stars 11 forks source link

Call api method before the external library is loaded #8

Closed mrbatista closed 7 years ago

mrbatista commented 8 years ago

Before call api method is necessary to ensure that external library is loaded.

angular.forEach(apiMethods, function(method) {
 ZendeskWidgetApi.prototype[method] = function() {
  $window.zE[method].apply($window.zE, arguments);
 };
});

It's possible that $windows.zE[method] is undefined if library is not loaded. This PR fix this issue

mrbatista commented 8 years ago

@bsouthga PTAL

mrbatista commented 8 years ago

@yangchristian all api support "before page load". see official documentation

yangchristian commented 8 years ago

Hmm, looks like then we'll need to adjust the tests so that continuous integration doesn't fail. In particular, we'll need to modify the mock service. Let me know if you have time to take a look, otherwise I can probably get to it this weekend. Thanks!

yangchristian commented 7 years ago

@mrbatista: Couple updates:

Thanks!

mrbatista commented 7 years ago

@yangchristian PTAL

yangchristian commented 7 years ago

@mrbatista: merged. Thanks for the contrib!

mrbatista commented 7 years ago

@yangchristian please publish new version on bower. Thanks!

yangchristian commented 7 years ago

@mrbatista: v0.1.1 up. Thanks again!