0

I am using JQM from last one year. I have developed a pop up screen In jqm Fiddle. Can we develop this type of pop up screen in angular js? It means open a pop up screen when button is click. With edit field and button in that?

$(function(){
  $('#openPopup').click(function(){
      $( "#testCaseId" ).popup( "open" );
  })
})
takendarkk
  • 3,347
  • 8
  • 25
  • 37
Pallavi Sharma
  • 635
  • 2
  • 16
  • 45

2 Answers2

1

angular-ui-bootstrap is port of bootstrap re-written in angular...

you can checkout this plunker on how to create modal popup

to learn how to create other bootstrap components in angularjs checkout ui-bootstrap

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());
    });
harishr
  • 17,807
  • 9
  • 78
  • 125
-1

Its fairly straight-forward to leverage bootstrap to create your modal popup:

Modal Directive

app.directive('modal', function () {
    return {
        restrict: 'A',
        scope: true,
        transclude: true,
        templateUrl: 'modalTemplate.html',
        link: function (scope, element, attr) {
            scope.id = attr.id;
            scope.title = attr.title;
            element.removeAttr('id');
        }
    }
})

HTML

<body ng-app="app" ng-controller="ctrl">
    <!-- Button trigger modal -->
    <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
        Launch demo modal
    </button>

    <div title="This is the modal title" id="myModal" modal>
        This is the modal content
    </div>
</body>

Demo Plunker

Michael Kang
  • 52,003
  • 16
  • 103
  • 135