angularjs - how to call function outside of javascript file -
i calling 1 function ng-change in html , in controller
html
ng-change="valueset(selectedaddress);" function inside controller
$scope.valueset=function(val){ globalvar=val.latitude; sessionstorage.setitem('latitude',globalvar); console.log('setting globalvar'+sessionstorage.getitem('latitude')); } javascript file
window.gs.prototype.jsfunction = function(){ var city= new ol.feature({ geometry: new ol.geom.point( ol.proj.fromlonlat( [4.342342, parseint(sessionstorage.getitem('latitude')) ])) }); } in javascript file when calling sessionstorage.getitem('latitude') getting value first time want change value in javascript file whenever input value change. have defined global variable out of controller globalvar="";
Comments
Post a Comment