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.