Skip to content

$$hashKey problem #156

@vladradulescu1

Description

@vladradulescu1

When I define in a normal way my layoutOptions it works:

Controller

 $scope.layoutOptions = { // layout with explicit save
      storageId: 'demo-layouts-explicit-save',
      storage: localStorage,
      storageHash: 'fs4df4d51',
      widgetDefinitions:[], // []
      defaultWidgets: [],
      explicitSave: true,
      defaultLayouts: [
        {title: 'Layout 1', active: true, defaultWidgets: []}
      ]
    }; 

If I try via rest service way i get this $$hasKey problem

 OtherService.then(function (allWidgets) {
    $log.debug('allWidgets ', allWidgets);
    $scope.layoutOptions = {};
    $scope.layoutOptions.storageId = 'demo-layouts-explicit-save';
    $scope.layoutOptions.storage = localStorage;
    $scope.layoutOptions.storageHash = 'fs4df4d51';
    $scope.layoutOptions.widgetDefinitions = allWidgets; // returns [{name:'widget1'},{name:'widget2'}]
    $scope.layoutOptions.defaultWidgets = [];
    $scope.layoutOptions.explicitSave = true;
    $scope.layoutOptions.defaultLayouts = [
        {title: 'Layout 1', active: true, defaultWidgets: []}
      ];
    $log.debug('layoutOptions =',$scope.layoutOptions);
  });

Log:

 TypeError: Cannot read property '$$hashKey' of undefined
at Object.extend (http://localhost:9000/bower_components/angular/angular.js:406:14)
at Object.LayoutStorage (http://localhost:9000/bower_components/malhar-angular-dashboard/dist/malhar-angular-dashboard.js:1064:15)
at link (http://localhost:9000/bower_components/malhar-angular-dashboard/dist/malhar-angular-dashboard.js:628:31)
at invokeLinkFn (http://localhost:9000/bower_components/angular/angular.js:8194:9)
at nodeLinkFn (http://localhost:9000/bower_components/angular/angular.js:7706:11)
at http://localhost:9000/bower_components/angular/angular.js:7937:13
at processQueue (http://localhost:9000/bower_components/angular/angular.js:13137:27)
at http://localhost:9000/bower_components/angular/angular.js:13153:27
at Scope.$eval (http://localhost:9000/bower_components/angular/angular.js:14353:28)
at Scope.$digest (http://localhost:9000/bower_components/angular/angular.js:14169:31) <div dashboard-layouts="layoutOptions" class="dashboard-container ng-scope">

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions