Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2.  
  3. lmpApp.controller('ValueController', function ($scope, resolvedValue, Value, resolvedStock) {
  4.  
  5.         $scope.values = resolvedValue;
  6.         $scope.stocks = resolvedStock;
  7.  
  8.         $scope.create = function () {
  9.             Value.save($scope.value,
  10.                 function () {
  11.                     $scope.values = Value.query();
  12.                     $('#saveValueModal').modal('hide');
  13.                     $scope.clear();
  14.                 });
  15.         };
  16.  
  17.         $scope.update = function (id) {
  18.             $scope.value = Value.get({id: id});
  19.             $('#saveValueModal').modal('show');
  20.         };
  21.  
  22.         $scope.delete = function (id) {
  23.             Value.delete({id: id},
  24.                 function () {
  25.                     $scope.values = Value.query();
  26.                 });
  27.         };
  28.  
  29.         $scope.clear = function () {
  30.             $scope.value = {year: null, value: null, id: null};
  31.         };
  32.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement