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

Php operator `break` doesn't stop while -

ubuntu - Bash Script to Check That Files Are Being Created -

vim: Search & replace -