Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Angular Material Login Form ( Model )
<html lang="en" ng-app="LoginApp">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Angular Material requires Angular.js Libraries -->
<script src=""></script>
<script src=""></script>
<script src=""></script>
<!-- Angular Material Library -->
<script src=""></script>
<!-- Angular Material style sheet -->
<link href="" rel="stylesheet">
<link rel="stylesheet" href="">
<body ng-controller="navController as navController">
<!-- Login Button-->
<md-button layout-align-sm="left" class="md-fab md-primary" aria-label="Profile" ng-click="navController.showAdvanced($event)">
<md-icon><i class="material-icons">&#xE899;</i></md-icon>
<!--loginModal -->
<script type="text/ng-template" id="loginModal.tmpl.html">
<md-dialog aria-label="ITS - Portal LogIn" ng-controller="navController as navController">
<form ng-cloak name="loginform" autocomplete="off">
<div class="md-toolbar-tools">
<h2>Modal LogIn Form</h2>
<span flex></span>
<md-button class="md-icon-button" ng-click="close()">
<i class="material-icons">highlight_off</i>
<md-dialog-content layout="row">
<div layout-padding>
<img src="" />
<div class="md-dialog-content">
<md-input-container class="md-block">
<label>User Name</label>
<input type="text" ng-model="" autocomplete="off">
<md-input-container class="md-block">
<label>User Password</label>
<input type="password" ng-model="user.password" autocomplete="nope">
<md-button class="md-raised md-primary md-button md-ink-ripple" ng-click="answer('LogIn')">
<md-button ng-click="answer('Cancel')">
angular.module("LoginApp", ['ngMaterial','modalModule'])
// modal module //
var modalModules = angular.module('modalModule',[]);
// modal Controller //
modalModules.controller('navController', function ($mdDialog) {
this.showAdvanced = function (ev) {
controller: navController2,
templateUrl: 'loginModal.tmpl.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose: true,
fullscreen: this.customFullscreen
// modal con
function navController2($scope, $mdDialog) {
$scope.close = function () {
$scope.hide = function () {
$scope.answer = function (answer) {
}//end modal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.