I am writing a web application using the AngularJS and PHP. I want to open a pop-up by passing a few params and render a new page in the pop-up. How can I open a fancy-box like i-frame pop-up in AngularJS ?
Asked
Active
Viewed 4,199 times
2

Anish Nair
- 3,238
- 29
- 41

Pradeep Jaiswar
- 1,785
- 7
- 27
- 48
-
Is the solution reside in the thread http://stackoverflow.com/questions/15812203/angularjs-show-popups-the-most-elegant-way – Vimal Patel Dec 11 '13 at 06:33
1 Answers
2
You do pretty much anything using AngularUI
library. Here's working fiddle for it.
Sample code would be:
HTML
<div ng-controller="ModalDemoCtrl">
<button class="btn" ng-click="open()">Open me!</button>
<div ng-show="selected">Selection from a modal: {{ selected }}</div>
</div>
JavaScript
var ModalDemoCtrl = function ($scope, $modal, $log) {
$scope.items = ['item1', 'item2', 'item3'];
$scope.open = function () {
var modalInstance = $modal.open({
templateUrl: 'some-dynamic.php',
controller: ModalInstanceCtrl,
resolve: {
items: function () {
return $scope.items;
}
}
});
modalInstance.result.then(function (selectedItem) {
$scope.selected = selectedItem;
}, function () {
$log.info('Modal dismissed at: ' + new Date());
});
};
};
some-dynamic.php
<?php
echo "Some <b>html in</b> the modal";
Of course you should change the code above before you have fully working example.

Omar Al-Ithawi
- 4,988
- 5
- 36
- 47
-
cab u please check your fiddle http://plnkr.co/edit/?p=preview i think u have missed typed it . – Pradeep Jaiswar Dec 11 '13 at 07:33
-
Sure :). Anyway it's the standard fiddle from AngularUI so you still have to do code changes like I suggested. – Omar Al-Ithawi Dec 11 '13 at 13:47