Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- lmpApp.controller('ValueController', function ($scope, resolvedValue, Value, resolvedStock) {
- $scope.values = resolvedValue;
- $scope.stocks = resolvedStock;
- $scope.create = function () {
- Value.save($scope.value,
- function () {
- $scope.values = Value.query();
- $('#saveValueModal').modal('hide');
- $scope.clear();
- });
- };
- $scope.update = function (id) {
- $scope.value = Value.get({id: id});
- $('#saveValueModal').modal('show');
- };
- $scope.delete = function (id) {
- Value.delete({id: id},
- function () {
- $scope.values = Value.query();
- });
- };
- $scope.clear = function () {
- $scope.value = {year: null, value: null, id: null};
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement