Sha256: 555d6f6fc903d6eee9516dca6824848f7a098d0df640cd84a0f44635ae57ff5e

Contents?: true

Size: 663 Bytes

Versions: 7

Compression:

Stored size: 663 Bytes

Contents

'use strict';

angular.module('entangledTest')

.controller('ListCtrl', function($scope, $routeParams, List) {
  List.find($routeParams.id, function(list) {
    $scope.$apply(function() {
      $scope.list = list;
      $scope.list.items().all(function(items) {
        $scope.$apply(function() {
          $scope.items = items;
        });
      });

      $scope.item = $scope.list.items().new();
    });
  });

  $scope.createItem = function() {
    $scope.item.$save(function() {
      $scope.$apply(function() {
        $scope.item = $scope.list.items().new();
      });
    });
  };

  $scope.updateItem = function(event, item) {
    item.$save();
  };
});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
entangled-1.4.1 spec/dummy/public/app/controllers/list.js
entangled-1.4.0 spec/dummy/public/app/controllers/list.js
entangled-1.2.0 spec/dummy/public/app/controllers/list.js
entangled-1.1.1 spec/dummy/public/app/controllers/list.js
entangled-1.1.0 spec/dummy/public/app/controllers/list.js
entangled-1.0.0 spec/dummy/public/app/controllers/list.js
entangled-0.0.26 spec/dummy/public/app/controllers/list.js