I am developing a panel with sortable, dockable, floating widgets. One of the controls I use generates floating widgets as HTML at the bottom of the DOM, before the closing body tag. This effectively removes the actions performed in the window controls from the control area in which they are created.
I am developing this control panel controller using controllerAs syntax, but I canβt understand how to efficiently update a view using this syntax when an external component performs an action that affects the data for the view?
Note. This is not the only thing I came across, which forces me to manually update the main view. There are also directives elsewhere on the page that perform actions that affect the presentation.
Ideally, I will never have to update the view manually, because I will use all the commands that occur inside the Angular built-in commands that affect the digest cycle, but that was not an option for me.
So ... if I were using $scope , I could just do:
$scope.$digest
Or
$scope.$apply
But how can I achieve the same effect using a controller like?
var vm = this; vm.array = [item, item]; vm.something = something;
source share