Whenever you want to share some data between AngularJS controllers or whenever you want to pass some data from one controller to other controller, then you can communicate between controllers in multiple ways.
By Sharing a Service:
You can share a common service between two controllers.
consider you have the following service called 'myService' which returns an array like below.
var myApp = angular.module('myApp', []);
...
Learn concepts on Javascript, JQuery, AngularJs, Asp.net, Ado.net.
Showing posts with label angularJS controllers. Show all posts
Showing posts with label angularJS controllers. Show all posts
Uncaught ReferenceError:Controller is not defined in AngularJS
If you have some AngularJS code like this,
var mailApp = angular.module('myMail', []);
function emailRouteConfig($routeProvider) {
$routeProvider.when('/', { controller: listController, templateUrl: 'list.html' }).
when('/view/:id', { controller: DetailController, templateUrl: 'detail.html' }).
...
Subscribe to:
Posts (Atom)