Resources: https://github.com/angular-ui/bootstrap/tree/master/src/modal
<< Valuable code examples and documentation provided here.
<< Explore for creating engaging transition effects like Medium's login feature.
Get started by filling in the blanks and setting up your modal HTML + controller:
index.html:
<style type="text/css">
.login-intro.ng-enter { /*initial styles such as transparency, position etc*/ }
.login-intro.ng-enter.ng-enter-active { /*final styles that ngAnimate transitions for you*/ }
</style>
<div ng-controller="MainCtrl as main">
<a href="#" ng-click="main.openLoginModal()">Log in / Sign up</a>
</div>
main-controller.js:
(
var myModule = angular.module('myModule', ['ui.bootstrap']);
myModule.controller('MainCtrl as main', function($modal){
var controller = this;
controller.openLoginModal = function(){
var modalInstance = $modal.open({
templateUrl: 'login-template.html',
controller: 'LoginController as login'
};
modalInstance.result.then(function () {
// Redirect to the logged-in section of your website
}, function () {
// an optional action if the user cancels
});
});
})();
login-template.html:
<div ng-view class="login-intro">
<!--include login inputs, buttons, etc. here-->
</div>