$rootScope:inprog Action Already In Progress
Hi,
I'm trying to call function inside another function, whenever function called it throwing below error
ionic.bundle.min.js:150 Error: [$rootScope:inprog] http://errors.angularjs.org/1.5.3/$rootScope/inprog?p0=%24digest
at ionic.bundle.min.js:40
at n (ionic.bundle.min.js:169)
at m.$apply (ionic.bundle.min.js:177)
at m.$scope.highlightModel (app.js?v1602582296794:903)
at m.$scope.getPositions (app.js?v1602582296794:777)
at app.js?v1602582296794:817
at n (ionic.bundle.min.js:139)
at m.$eval (ionic.bundle.min.js:176)
at m.$digest (ionic.bundle.min.js:174)
at m.$apply (ionic.bundle.min.js:177)
(anonymous) @ ionic.bundle.min.js:150
(anonymous) @ ionic.bundle.min.js:123
$apply @ ionic.bundle.min.js:177
$scope.highlightModel @ app.js?v1602582296794:903
$scope.getPositions @ app.js?v1602582296794:777
(anonymous) @ app.js?v1602582296794:817
n @ ionic.bundle.min.js:139
$eval @ ionic.bundle.min.js:176
$digest @ ionic.bundle.min.js:174
$apply @ ionic.bundle.min.js:177
(anonymous) @ ionic.bundle.min.js:139
ionic.bundle.min.js:150 Error: [$rootScope:inprog] http://errors.angularjs.org/1.5.3/$rootScope/inprog?p0=%24digest
at ionic.bundle.min.js:40
at n (ionic.bundle.min.js:169)
at m.$digest (ionic.bundle.min.js:173)
at m.$apply (ionic.bundle.min.js:177)
at m.$scope.highlightModel (app.js?v1602582296794:903)
at m.$scope.getPositions (app.js?v1602582296794:777)
at app.js?v1602582296794:817
at n (ionic.bundle.min.js:139)
at m.$eval (ionic.bundle.min.js:176)
at m.$digest (ionic.bundle.min.js:174)
Function 1 :
var data = $scope.modelData[target + '-anchors'];
//console.log(data);
if (data != undefined && edata != "") {
// if we have previously colored an object, undo it
if ($scope.currentSelection != undefined) {
}
else {
// first time! unhide the pointer/labels
tml3dRenderer.setProperties('pinger', {
shader: "pinger;rings f 5;r f 1;g f 1;b f 0;rate f 3;direction f -1",
hidden: false
}
);
}
// we should get the ID of the item that was clicked - this is an occurence path id
var pathid = JSON.parse(edata).occurrence;
// find the selected item from the data that we loaded from the file ...
$scope.currentSelection = target + "-" + pathid;
// ... and get the location of the center center center of the bbox
var v = data[pathid].anchors["ccc"];
// move the pointer and label to the "ctc" (center top center) for the selected item
// note using lower-level TML api to move the node. Note that we also need to position
// RELATIVE to the actual model
tml3dRenderer.setTranslation('pinger', $scope.view.wdg['model-1'].x + v[0],
$scope.view.wdg['model-1'].y + v[1],
$scope.view.wdg['model-1'].z + v[2]);
}
data = $scope.modelData[target + '-all'];
if (data != undefined && edata != "") {
// we should get the ID of the item that was clicked - this is an occurence path id
//console.log(edata);
var pathid = JSON.parse(edata).occurrence;
if ($scope.app.params['mode'] == "Isolate") {
//console.log(target + ' ---- ' + pathid)
$scope.isolate(target, pathid);
}
else {
var partNumber = data.components[data.idmap[pathid].cid].properties['item_number'];
var partName = data.components[data.idmap[pathid].cid].properties['item_1'].toUpperCase();
var name = data.components[data.idmap[pathid].cid].properties['name'];
var template = '<ion-popover-view><ion-content> <small style="color:black;">Part Number</br></small> ' + partNumber +
' </br> <small style="color:black;">Part Description</br></small> ' + partName +
' </br> <small style="color:black;">Part Name</br></small> ' + name + ' </ion-content></ion-popover-view>';
var popover = $ionicPopover.fromTemplate(template, {
scope: $scope
}
);
var customEvent = {
target: {
getBoundingClientRect: function () {
return {
'left': $scope.isHost ? $scope.lastClick.x : pagex,
'top': $scope.isHost ? $scope.lastClick.y : pagey,
'width': 1,
'height': 1,
'background-color': 'rgba(255,255,255,1)'
};
}
}
};
// show the popup at the specifed location
popover.show(customEvent);
// define what to do when the popover is dismissed (manual or timer)
var dismissF = function (modelItem, popover) {
var modelItemId = modelItem;
var thePopover = popover;
return function () {
$scope.shade(modelItemId, false);
thePopover.remove();
}
}
// auto-close the popover after 3 seconds
$scope.shade(target + "-" + pathid, true);
var timeoutValue = 3000;
if($scope.app.params.mode == 'DrillDown'){
timeoutValue = 1000}
$timeout(dismissF(target + "-" + pathid, popover), timeoutValue);
$scope.$apply();
}
}
Function 2:
var data = twx.app.mdl['Thing'].svc['Service'].data;
//all data from service.
for (var i = 0; i < data.length; i++) {
var row = data[i];
try {
var arrayIndexValue = $scope.collaboration.nav_objects.findIndex(function(item,i){return item.id === row.UserName.substring(0,row.UserName.indexOf('@'));});
var nvo = $scope.collaboration.nav_objects[arrayIndexValue];
nvo.id = row.UserName.substring(0,row.UserName.indexOf('@'));
nvo.pos = new Vector4().FromString(row.Position);
nvo.gaze = new Vector4().FromString(row.Gaze);
var up = new Vector4().FromString(row.Up);
nvo.lpos = nvo.pos.Add(up.Scale(0.12));
// put the label approx 12cm up on top of the head
nvo.allocated = row.SeatAllocated;
if(row.EndMeeting)
{
}
else if (!row.SeatAllocated && row.UserName === $scope.app.params.currentUsername)
{
}
if(row.UserName === $scope.HostName && !$scope.isHost)
{
$scope.app.params['mode'] = row.Mode;
$scope.app.view['Home'].wdg['textInput-2'].text = row.SearchItem;
if ($scope.localSearchItem != row.SearchItem)
{
$scope.localSearchItem = row.SearchItem;
}
if(row.EventOccured){
$scope.highlightModel(row.Target,row.edata,row.PageX,row.PageY);
}
if(row.ResetRequested)
{
$scope.onreset();
}
}
}
catch(err)
{
$scope.collaboration.nav_objects.push({
name : "obj" + row.UserName.substring(0,row.UserName.indexOf('@')),
allocated : row.SeatAllocated,
pos : new Vector4().Set3(i/10,0,0),
lpos : new Vector4().Set3(i/10,0.12,0),
id : row.UserName.substring(0,row.UserName.indexOf('@'))
}
);
}
Could any one help me fix this issue
/VR

