Exchange data between controllers angularjs





JS, and paste the code I had in there.
But, if you have 2 views with 2 controllers, it is massage japonais coquin possible to share the scope variables(data) between controllers through services and factory.But, the scope variables are local to the controller itself so set the data to the service or factory to know about that.To navigate to this URL in our first template, we'll just say div ui-sref which means, "Take us to this state when we click." We'll say, "Go to second." Now clicking on "go to second" will take us to a blank page because.Similarly for here and here instead of first we can say greeting.This gives us the same greeting object or service on each controller with a message property which we can bind to from each controller.Directive counter function(timeout) return restrict: 'EAC template: div Directive Counter: internalCount /div, scope: internalCount: 'model', link: function(scope, element) function addCount timeout(function ternalCount 1; addCount, 1000) addCount ; and your template like this: div ng-app"myApp" div ng-controller"myCtrl" counter count /div /div You will find a working.Here it is model, so we will initialize internalCount with model, binding the data scope: internalCount: 'model we can also remove the initialization of the internalCount variable in the directive.The solution, however, synonyme coquin is amazingly simple and elegant.If you are using the same controller, the scope variables can be accessed in both views.Enjoy your complimentary solution view.Medium, security, public, views 746, who is Participating?Get started today, stand Outas the employee with proven skills.




[L_RANDNUM-10-999]
Sitemap