Showing posts with label angularJS controllers. Show all posts
Showing posts with label angularJS controllers. Show all posts

Call a controller from another controller in AngularJS

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', []); ...
Read more...

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' }).              ...
Read more...