I am currently learning Angular and focusing on the login form implementation.
The specific model I am working with can be found in this PLNKR. There are two challenges that I am struggling to resolve.
Issue 1: I'm trying to figure out how to turn the modal window into a standalone page. The code for the modal is located in "parentController.js":
$scope.modalShown = false; var showLoginDialog = function() { if(!$scope.modalShown){ $scope.modalShown = true; var modalInstance = $modal.open({ templateUrl : 'login.html', controller : "LoginCtrl", backdrop : 'static', }); modalInstance.result.then(function() { $scope.modalShown = false; }); } };
Issue 2: Within the login form, found in the "login.html" file, I need to replace the username div with a dropdown menu:
<div style="margin-top: 25px" class="input-group"> <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i> </span> <select class="form-control" name="username" ng-model="credentials.username"> <option value="Admin">Admin</option> <option value="Editor">Editor</option> <option value="Guest">Guest</option> </select> </div>
How can I replace the input field with a dropdown listing the usernames from an array (e.g., "Admin, Editor, Guest")?
Thank you for your assistance!