make reviewer requested changes

This commit is contained in:
Deep Tailor 2017-10-10 14:37:25 -07:00
parent a4a1cb5e05
commit 26210eaa50
2 changed files with 6 additions and 10 deletions

View File

@ -24,8 +24,8 @@
* Module defining ObjectInspectorController. Created by shale on 08/21/2015. * Module defining ObjectInspectorController. Created by shale on 08/21/2015.
*/ */
define( define(
['angular'], [],
function (angular) { function () {
/** /**
* The ObjectInspectorController gets and formats the data for * The ObjectInspectorController gets and formats the data for
@ -38,8 +38,6 @@ define(
$scope.contextutalParents = []; $scope.contextutalParents = [];
//$scope.isLink = false; //$scope.isLink = false;
this.InspectorMutation = $scope.ngModel.selectedObject.getCapability('mutation');
// Gets an array of the contextual parents/ancestors of the selected object // Gets an array of the contextual parents/ancestors of the selected object
function getContextualPath() { function getContextualPath() {
var currentObj = $scope.ngModel.selectedObject, var currentObj = $scope.ngModel.selectedObject,
@ -111,11 +109,9 @@ define(
getMetadata(); getMetadata();
}); });
this.InspectorMutation.listen(function () { var mutation = $scope.ngModel.selectedObject.getCapability('mutation');
if (!angular.equals($scope.metadata, $scope.ngModel.selectedObject.useCapability('metadata'))) { var unlisten = mutation.listen(getMetadata);
getMetadata(); $scope.$on('$destroy', unlisten);
}
});
} }
return ObjectInspectorController; return ObjectInspectorController;
} }

View File

@ -39,7 +39,7 @@ define(
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj( mockScope = jasmine.createSpyObj(
"$scope", "$scope",
["$watch"] ["$watch", "$on"]
); );
mockScope.ngModel = {}; mockScope.ngModel = {};
mockScope.ngModel.selectedObject = { mockScope.ngModel.selectedObject = {