Hi Suresh,
Make an directive out of it.
Inside the directive you can check if the script is loaded, if not dynamically load the script using your script-loader of choice.
Once loaded (I would use a promise to keep track of that!) call the needed functions GBS_insertEmbeddedViewer('ISBN:0738531367',600,500) or something similar.
Regards
Sander
<div data-embed-viewer="book.isbn"></div>appCommonDirective.directive('embedViewer', ['$compile',function($compile) {
return {
restrict: 'AE',
template: '<div></div',
replace: true,
scope: {
isbn: '=embedViewer'
},
link: function(scope, el, attrs) {
var rawTmpl = '<h1></h1><script type="text/javascript"> GBS_insertPreviewButtonPopup('+scope.isbn+');</script>';
scope.$watch('isbn', function(val) {
if (val) {
var template = $compile(rawTmpl)(scope);
el.html(template);
}
})
}
}
}]);--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/9d-rhMiXDmg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Hi Suresh,
GBS_insertPreviewButtonPopup seems to be incompatible with AngularJS(or other frameworks for that matter!) at first sight. I don’t have the time now to dive in deeply.
However, I reviewed the documentation, and it seems to be an top-level function for the rest of the library. You can use the lower-level stuff quite well with AngularJS.
I hope this helps a bit,
Regards
Sander
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/9d-rhMiXDmg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.