Cannot read property '$$hashKey' of undefined
TypeError: Cannot read property '$$hashKey' of undefined
at Object.extend (http://local.dev/js/vendor/angular.js:407:14)
at Scope.$scope.editCancel (http://local.dev/js/controllers/catCtrl.js:68:25)
at new <anonymous> (http://local.dev/js/controllers/catCtrl.js:123:11)
at Object.invoke (http://local.dev/js/vendor/angular.js:4180:17)
at extend.instance (http://local.dev/js/vendor/angular.js:8439:21)
at http://local.dev/js/vendor/angular.js:7691:13
at forEach (http://local.dev/js/vendor/angular.js:331:20)
at nodeLinkFn (http://local.dev/js/vendor/angular.js:7690:11)
at compositeLinkFn (http://local.dev/js/vendor/angular.js:7073:13)
at publicLinkFn (http://local.dev/js/vendor/angular.js:6952:30)
Is there a way to fix this ??
AngularJS v1.3.7 Angular UI Tree v2.1.5
+1, also having this issue!
You should post some code so we can see what you're trying to do. The array in your ng-repeat contains more than 0 elements?
I guess you have a case like the following:
angular.extend(object1, object2);
In this situation if object1 is null or "undefined", then it breaks your flow and you get an exception.
So, you may consider initializing object1 as an empty object in the first place if there is no reason not to do.
i.e. object1 = {};
@atheleron / @anselanza can you post a little more info about this issue? How can we reproduce the issue?
Closed due to inactivity.
Hi, i'm having this issue also. My issue is that angular requires me to put track by within my ng-repeat, but track by removes $$haskKey from the object.
@lingthing5 Are you also using angular.extend() at some point? In this case, you might still have some null or undefined values in your array. You should check the content of your iterable and possibly filter out those invalid values.
As an alternative you could also create a new object every time via angular.extend({}, yourOtherStuff, ...).
Indeed.. @EmreErdogan Solved my problem.
A nice tip is to use ES6 Syntax and always initialize the function params.
note: (params = {})
Im my case i had:
const someFunction = (params = {}) => {
angular.extend(params, itemX, itemY);
// ... logic
};