I'm developing a dashboard with sortable, dockable, floatable widgets. One of the controls I'm using generates the floating widgets as HTML at the bottom of the DOM, before the closing body tag. This effectively removes actions done in the window controls from the controller scope they are generated in.
I'm developing this dashboard controller using controllerAs syntax available, but I can't figure out how to effectively update the view with this syntax when an external component does an action that affects the data for the view?
Note: This is not the only I'm facing that forces me to manually update the main view. There are also directives elsewhere on the page that perform actions that impact the view.
Ideally, I would never have to update the view manually, because I would be using all commands that happen within the built in Angular commands affecting digest loop - but this was not an option for me.
So... if I was using $scope I would be able to simply do:
$scope.$digest
Or
$scope.$apply
But how do I achieve the same affect using controller as?
var vm = this;
vm.array = [item, item];
vm.something = something;
//External something changes something on a vm.variable
vm.update! //How??