Strong Password for AngularJS UI Pages

All of us have seen , for choosing a password we need combination of special characters, Capital letter , small letters, digits etc to make it strong.
 
Here is the code snippets to achieve this.
  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4.     <title>Strong Password for Angular UI Pages</title>  
  5.       
  6.     <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>    
  7.     <script>  
  8.         var app = angular.module("myApp", []);  
  9.         app.controller("myCtrl"function ($scope) {  
  10.   
  11.             var strongRegularExp = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})");  
  12.   
  13.             var mediumRegularExp = new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})");  
  14.   
  15.             $scope.checkpwdStrength = {  
  16.                 "width""150px",  
  17.                 "height""25px",  
  18.                 "float""right"  
  19.             };  
  20.   
  21.             $scope.validationInputPwdText = function (value) {  
  22.                 if (strongRegularExp.test(value)) {  
  23.                     $scope.checkpwdStrength["background-color"] = "green";  
  24.                     $scope.userPasswordstrength = 'You have a Very Strong Password now';  
  25.                 } else if (mediumRegularExp.test(value)) {  
  26.                     $scope.checkpwdStrength["background-color"] = "orange";  
  27.                     $scope.userPasswordstrength = 'Strong password, Please give a very strong password';  
  28.                 } else {  
  29.                     $scope.checkpwdStrength["background-color"] = "red";  
  30.                     $scope.userPasswordstrength = 'Weak Password , Please give a strong password';  
  31.                 }  
  32.             };  
  33.   
  34.         });  
  35.     </script>  
  36. </head>  
  37. <body ng-app="myApp">  
  38.     <div ng-controller="myCtrl" style="border:5px solid gray; width:800px;">  
  39.         <div>  
  40.             <h3>Strong Password for Angular UI Pages </h3>  
  41.         </div>  
  42.         <div style="padding-left:25px;">  
  43.             <div ng-style="checkpwdStrength"></div>  
  44.             <input type="password" ng-model="userPassword" ng-change="validationInputPwdText(userPassword)" class="class1" />  
  45.             <b> {{userPasswordstrength}}</b>  
  46.         </div>  
  47.         <br />  
  48.         <br />  
  49.         <br />  
  50.     </div>  
  51. </body>  
  52. </html>