I have a settings controllers that is responsible of saving settings of my web app.
This SettingsController has a simple $scope.saveSettings method. The settings controller is associated with settings.html defined as follows:
.config(['$locationProvider','$routeProvider', function ($locationProvider, $routeProvider) { $routeProvider.when('/widgets', { templateUrl: 'partials/widgets.html', controller: 'widgetsController'}); $routeProvider.when('/settings', { templateUrl: 'partials/settings.html', controller:'settingsController' }); $routeProvider.otherwise({redirectTo: '/widgets'}); }])
If I want to have a button 'Save Settings' outside of settings.html (e.g in main.html) they are not invoked, because the main/parent controller assosiaciated with the main view doesn't know anything about saveSettings().
What can be done about things like that?
My main.html has the
that injects settings.html when the route path is /settings