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

View File

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