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
Post a Comment