Q:

Redirect one html page to another in pop up using angularjs

I am using angularjs. I need to open one html page from another in a pop up/modal. Actually needs a common html page with script(angular controller), which is open from different multiple view page as a modal/pop up, and also can do CRUD in modal.
<div><button data-ng-click="openModal()">Click</button></div>

and in controller
$scope.openModal = function(){  // Do something to open another html view page in a modal    }

Also i need some information send from current UI to modal UI as a parameter.

A:

var app = angular.module('someapp');
$scope.openModal = function(){
    var modalInstance = $uibModal.open({
        templateUrl: 'xyz.html',
        controller: 'someconroller',
        resolve: {
            argumentToSend: function () {
                return 'sample-text';
            }
        }
    });

    modalInstance.result.then(function (returnedItem) {
        console.log(returnedItem);
    }, function () {
    })
};

app.controller('someconroller', ['$scope', '$uibModalInstance', 'argumentToSend', function ($scope, $uibModalInstance, argumentToSend) {
    console.log(argumentToSend);
    //You can call your services,apis for crud operations here
    $scope.exit = function () {
        $uibModalInstance.close(returnedItem);
    };
}]);

