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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -