My application is made up of the following components:
The index view containing the navbar and search box, managed by a nav controller. Two HTML pages within an ng-view element, each with its own controller - customerController and contactsController. These pages display tables populated with data retrieved from a service.
How can I pass a value from the navbar controller to the other two controllers in order to filter the table? The ng-view is not nested inside the navController scope.
This is my routing configuration:
app.config(function ($routeProvider) {
$routeProvider
.when("/Customers", {
templateUrl: "app/customers-list.html",
controller: "customerController"
})
.when("/Contacts", {
templateUrl: "app/contacts-list.html",
controller: "contactController"
})
.when("/Prospects", {
templateUrl: "app/saleprospect-list.html",
controller: "prospectController"
})
.when("/Prospects/add", {
templateUrl: "app/salesprospect-add.html",
controller: "addController"
})
.when("/Prospects/:index", {
templateUrl: "app/salesprospect-add.html",
controller: "editController"
})
.otherwise({
redirectTo: "/Customers"
})
});