javascript - Call angular function from plain JS -


i'm trying integrate fastsprings js library angular.js application. have embed fastsprings library html head like:

<script id="fsc-api" src="..." data-popup-closed="onpopupclose" /> 

i've created directive uses document.createelement build script tag , add document. problem data-popup-closed contains name of callback function called if fastspring popup gets closed. tried create function inside directive doesn't work because exists inside angular scope then.

what best way handle such situations? not fastspring specific question, problem should occur if want integrate library awaits plain js callback function.

can try propagate "onpopupclose" function outside of angulars scope? like: window. onpopupclose = $scope. onpopupclose; in angular app , can use function outside.. call window.onpopupclose()


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -