Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('ui.bootstrap.demo', ['ui.bootstrap']);
- angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl', function ($scope, $modal, $log,$http) {
- var poData= $http.get('add_po.php').success(function(data){
- $scope.items =data;});
- $scope.open = function (size) {
- var modalInstance = $modal.open({
- templateUrl: 'myModalContent.html',
- controller: 'ModalInstanceCtrl',
- size: size,
- resolve: {
- items: function () {
- return $scope.items;
- }
- }
- });
- modalInstance.result.then(function (selectedItem) {
- $scope.selected = selectedItem;
- }, function () {
- $log.info('Modal dismissed at: ' + new Date());
- });
- };
- });
- angular.module('ui.bootstrap.demo').controller('ModalSpgCtrl', function ($scope, $modal, $log,$http) {
- var poData= $http.get('add_spg.php').success(function(data){
- $scope.items =data;});
- $scope.open = function (size) {
- var modalInstance = $modal.open({
- templateUrl: 'spgModalContent.html',
- controller: 'ModalInstanceCtrl',
- size: size,
- resolve: {
- items: function () {
- return $scope.items;
- }
- }
- });
- modalInstance.result.then(function (selectedItem) {
- $scope.selected = selectedItem;
- }, function () {
- $log.info('Modal dismissed at: ' + new Date());
- });
- };
- });
- angular.module('ui.bootstrap.demo').controller('ModalInsCtrl',
- function ($scope, $modal, $log,$http) {
- var poData= $http.get('add_material.php')
- .success(function(data){
- $scope.items = data;
- });
- $scope.open = function (size, $index) {
- var modalInstance = $modal.open({
- templateUrl: 'insModalContent.html',
- controller: 'ModalInsertCtrl',
- size: size,
- resolve: {
- items: function () {
- return $scope.items;
- }
- }
- });
- modalInstance.result.then(function (selectedItem) {
- $scope.selected = selectedItem;
- }, function () {
- $log.info('Modal dismissed at: ' + new Date());
- });
- };
- $scope.eyes = [];
- $scope.activeEye = {
- kd_barang: '',
- nama_pemasok: '',
- satuan: '',
- qty:'',
- valuta:''
- }
- $scope.delete = function(index){
- $scope.eyes.splice(index,1);
- }
- $scope.add = function ($index) {
- $scope.eyes.push($scope.activeEye);
- $scope.activeEye = {} /* reset active item*/
- }
- });
- // Please note that $modalInstance represents a modal window (instance) dependency.
- // It is not the same as the $modal service used above.
- angular.module('ui.bootstrap.demo').controller('ModalInsertCtrl', function ($scope, $modalInstance, items) {
- $scope.items = items;
- $scope.selected = {
- item: $scope.items[0]
- };
- $scope.ok = function () {
- $modalInstance.close($scope.selected.item);
- };
- $scope.cancel = function () {
- $modalInstance.dismiss('cancel');
- };
- });
- angular.module('ui.bootstrap.demo').controller('ModalInstanceCtrl', function ($scope, $modalInstance, items) {
- $scope.items = items;
- $scope.selected = {
- item: $scope.items[0]
- };
- $scope.ok = function () {
- $modalInstance.close($scope.selected.item);
- };
- $scope.cancel = function () {
- $modalInstance.dismiss('cancel');
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement