javascript - AngularJS - Array in other JS file -


i trying make website. main (angularjs) controller requests json data, filters , pushes array. use said array in different javascript file , can't wrap head around how it.

i read option create service multiple times believe passing variables between 2 controllers. moreover, other options did not work out me well.

what best approach this? lot.

you can create global javascript variable accessible both controller other js file. update value controller change @ global level.

then in next file retrieve it.


Comments

Popular posts from this blog

many to many - Django Rest Framework ManyToMany filter multiple values -

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

Java Entity Manager - JSON reader was expecting a value but found 'db' -