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

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -