Advertisement
Guest User

Untitled

a guest
Aug 29th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular.module("umbraco").controller("Scandbio.Products.EditController", function ($scope, $filter, notificationsService, dialogService, assetsService, ecommerceProductsResource) {
  2.  
  3.     // PROPERTIES
  4.     $scope.content = {
  5.         tabs: [
  6.             { id: 1, label: "Artiklar" },
  7.             { id: 2, label: "Extra tillval" }
  8.         ]
  9.     };
  10.  
  11.     $scope.model = $scope.model || defaultModel();
  12.  
  13.     // SCOPE FUNCTIONS
  14.     $scope.add = function () {
  15.         alert("Time to add some products!!");
  16.         console.log(dialogService);
  17.         dialogService.open({
  18.             template: "~/App_Plugins/Scandbio/backoffice/products/dialog.add.html",
  19.             show: true,
  20.             callback: function (data) {
  21.                 $scope.actionInProgress = true;
  22.                 console.log(data);
  23.             }
  24.         });
  25.     };
  26.  
  27.     // HELPER FUNCTIONS
  28.     function defaultModel() {
  29.         return [];
  30.     };
  31.  
  32.     function init() {
  33.         $scope.actionInProgress = true;
  34.         $scope.model = ecommerceProductsResource.products.get();
  35.         $scope.actionInProgress = false;
  36.     };
  37.     init();
  38.  
  39. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement