*any help here please ?*
On Wednesday, June 10, 2015 at 2:39:52 PM UTC+2, Ahmed Amen wrote:
>
> Hi
>
> *i have create an invoice with angular and pass data throw API Controller
> - i store data in list to let me save it on database when i need, but when
> i open new invoice from my PC and add item's on it before i save it
> to database i open another invoice from other PC and when it's open i got
> the item's from invoice in my pc on it too - i don't know how to set it to
> open with empty array in each PC to be works as it should be ?*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *(function () { var app = angular.module('jqanim', []);
> app.controller('InvoiceController', function ($scope, $http) {
> $scope.tax = 0.00; $scope.PercentageDiscount = 0.00;
> $scope.MoneyDiscount = 0.00; $scope.Total = 0.00;
> $scope.save = function () {
> $http.post("/api/customerService/Post", $scope.item).success(function
> (data) { $scope.orders.push(data); // Clear
> AutoComplete Text
> $("#Products").data("kendoAutoComplete").value(""); if
> (window.event.keyCode == 13) { $("#ProductID").focus();
> } $('#ProductID').prop('readonly', false);
> }); }; $scope.saveInvoice = function () {
> $http.post("/api/customerService/SaveInvoice", $scope.invoice)
> .success(function (data) { // Clear AutoComplete Text
> $("#Customers").data("kendoAutoComplete").value("");
> $scope.invoice = []; $scope.orders =
> []; $scope.tax = 0.00;
> $scope.PercentageDiscount = 0.00; $scope.MoneyDiscount
> = 0.00; alertify.set('notifier', 'position',
> 'top-left'); alertify.success('تم حفظ الفاتورة', 3);
> }) .error(function (data) {
> alertify.set('notifier', 'position', 'top-right');
> alertify.error('يوجد خطأ', 2); return;
> }); }; $scope.remove = function (id, index) {
> $http.delete("/api/customerService?id=" + id).success(function (data) {
> $scope.orders.splice(index, 1); }); };
> $http.get("/api/CustomerService/getDetails").success(function (data) {
> $scope.orders = data; }); $scope.keypress = function
> (id) { if (window.event.keyCode == 13) {
> $http.get("/api/CustomerService/GetProduct?id=" + id).success(function
> (data) { angular.forEach(data, function (item) {
> $("#Products").val(item.ProductName).trigger('change');
> $("#SellPrice").val(item.sell_price).trigger('change');
> $("#Stock").val(item.stock).trigger('change');
> $("#Quantity").focus(); });
> }); }*
> ...
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.