mirror of
https://github.com/nasa/openmct.git
synced 2025-05-09 12:03:21 +00:00
Merge pull request #1352 from nasa/open1351
[Navigation] Fix errors appearing in console on application load
This commit is contained in:
commit
a920220122
@ -52,7 +52,7 @@ define(
|
|||||||
var currentIds = $route.current.params.ids;
|
var currentIds = $route.current.params.ids;
|
||||||
|
|
||||||
$scope.treeModel = {
|
$scope.treeModel = {
|
||||||
selectedObject: {}
|
selectedObject: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
function idsForObject(domainObject) {
|
function idsForObject(domainObject) {
|
||||||
@ -139,7 +139,11 @@ define(
|
|||||||
|
|
||||||
// Also listen for changes which come from the tree. Changes in
|
// Also listen for changes which come from the tree. Changes in
|
||||||
// the tree will trigger a change in browse navigation state.
|
// the tree will trigger a change in browse navigation state.
|
||||||
$scope.$watch("treeModel.selectedObject", navigateDirectlyToModel);
|
$scope.$watch("treeModel.selectedObject", function (newObject, oldObject) {
|
||||||
|
if (oldObject !== newObject) {
|
||||||
|
navigateDirectlyToModel(newObject);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// Listen for route changes which are caused by browser events
|
// Listen for route changes which are caused by browser events
|
||||||
|
Loading…
x
Reference in New Issue
Block a user