How to share data between two modules in AngularJS? -



How to share data between two modules in AngularJS? -

i using angularjs along c# mvc. have home page user enters info , should passed sec module utilize info processing , decisions. have utilize info entered or updated in first module within sec module. can help me how accomplish this?

hope next implementation help understanding.

angular.module('app.a', []) .service('servicea', function() { this.getvalue = function() { homecoming this.myvalue; }; this.setvalue = function(newvalue) { this.myvalue = newvalue; } }); angular.module('app.b', ['app.a']) .service('serviceb', function(servicea) { this.getvalue = function() { homecoming servicea.getvalue(); }; this.setvalue = function() { servicea.setvalue('new value'); } });

angularjs angularjs-module

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -