Created
December 2, 2013 15:53
-
-
Save mwilc0x/7751597 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inject $rootScope into application when we bootstrap | |
// call below line of code when save is called after | |
// client has been switched (ie. we have called the re-assign dialog and user clicked continue) | |
$rootScope.$broadcast('clientChange'); | |
app.controller('MainCtrl', function MainCtrl() { | |
$scope.MainClientSelected = {}; | |
$scope.Client2Selected = {}; | |
function updateDependants(users) { | |
$scope.current_users = users.users; | |
$scope.$apply(); | |
} | |
function updateStockOptions(users) { | |
$scope.current_users = users.users; | |
$scope.$apply(); | |
} | |
// add more functions for each section that depends on client change | |
$scope.$on('clientChange', function (evt, users) { | |
updateDependants(users); | |
updateStockOptions(users); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment