(function() { 'use strict'; window.app.directive('movementReport', function() { return { scope: { movementData: "=" }, templateUrl: '/report/template/movementReport.tmpl.cshtml', controller: controller, controllerAs: 'vm' } }); controller.$inject = ['$scope', '$uibModal', 'inventorySvc']; function controller($scope, $uibModal, inventorySvc) { var vm = this; vm.movementData = $scope.movementData; vm.editInventory = function (inventoryId) { inventorySvc.find(inventoryId) .success(function (inventory) { $uibModal.open({ template: '', scope: angular.extend($scope.$new(true), { inventory: inventory }) }); }); } } })();