麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 網站 > WEB開發 > 正文

Ionic+AngularJS登錄和注冊帶驗證

2024-04-27 15:18:17
字體:
來源:轉載
供稿:網友

登錄:

<!DOCTYPE html><html><head>    <meta charset="utf-8">    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">    <title></title>    <link rel="manifest" href="manifest.json">    <!-- un-comment this code to enable service worker    <script>      if ('serviceWorker' in navigator) {        navigator.serviceWorker.register('service-worker.js')          .then(() => console.log('service worker installed'))          .catch(err => console.log('Error', err));      }    </script>-->    <link href="lib/ionic/CSS/ionic.css" rel="stylesheet">    <link href="css/style.css" rel="stylesheet">    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above    <link href="css/ionic.app.css" rel="stylesheet">    -->    <!-- ionic/angularjs js -->    <script src="lib/ionic/js/ionic.bundle.js"></script>    <!-- cordova script (this will be a 404 during development) -->    <script src="cordova.js"></script>    <!-- your app's js -->    <script src="js/app.js"></script>    <script src="js/Login.js"></script></head><body ng-app="myApp" ng-controller="myCtrl">    <ion-pane>        <ion-content>            <div class="bar bar-header ">                <div class="h1 title">用戶登錄</div>            </div>            <div class="content has-header">                <form ng-submit="onSubmit(myForm.$valid)"  name="myForm"  novalidate>                    <div class="list">                        <div class="item-input-inset">                            <label class="item-input-wrapper">                                <i class="icon ion-person"></i>                                <input type="text" name="user" id="user" ng-model="user" placeholder="用戶名" required>                                <div ng-show="myForm.user.$invalid && submitted">                                    <div style="color:red" ng-show="myForm.user.$error.required">用戶名是必須的</div>                                </div>                            </label>                        </div>                        <div class="item-input-inset">                            <label class="item-input-wrapper">                                <i class="icon ion-locked"></i>                                <input type="passWord" name="password" ng-model="password" id="password" placeholder="密碼" required>                                <div ng-show="myForm.password.$invalid && submitted">                                    <div style="color:red" ng-show="myForm.password.$error.required">密碼是必須的</div>                                </div>                            </label>                        </div>                    </div>                    <div class="padding">                        <button class="button button-full button-dark" type="submit">登錄</button>                    </div>                </form>            </div>              </ion-content>    </ion-pane>    <script>          'use strict';     var myApp = angular.module('myApp',[]);  myApp.controller('myCtrl',['$scope', '$http',function($scope, $http){  // $scope.formModel = {};  $scope.submitted = false;  $scope.onSubmit = function(){    if ($scope.myForm.$valid) {        var param = {                User: $scope.user,                Pwd: $scope.password            }        $http.post('someurl',param)      .success(function(data){        console.log(':)');      })      .error(function(data){        console.log(':(');      });      console.log(param);}else{    $scope.submitted = true;}      }}]);    </script>  </body></html>不填寫信息登錄就會如圖所示:

注冊:

<!DOCTYPE html><html><head>    <meta charset="utf-8">    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">    <title></title>    <link href="lib/ionic/css/ionic.min.css" rel="stylesheet">    <link href="css/style.css" rel="stylesheet">    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above      <link href="css/ionic.app.css" rel="stylesheet">      -->    <!-- ionic/angularjs js -->    <script src="lib/ionic/js/ionic.bundle.js"></script>    <!-- cordova script (this will be a 404 during development) -->    <script src="cordova.js"></script>    <!-- your app's js -->    <script src="js/app.js"></script>    <script src="js/Register.js"></script>    <!--  <script src="js/controllers.js"></script>    <script src="js/services.js"></script> --></head><body ng-app="myApp" ng-controller="myCtrl">    <!--       The nav bar that will be updated as we navigate between views.     -->    <!--        The views will be rendered in the <ion-nav-view> directive below        Templates are in the /templates folder (but you could also        have templates inline in this html file if you'd like).      -->    <ion-nav-view>        <ion-content>            <div class="bar bar-header ">                <div class="h1 title">用戶注冊</div>            </div>            <div class="content has-header">                <form ng-submit="onSubmit(myForm.$valid)" name="myForm" novalidate>                    <div class="list">                        <div class="item-input-inset">                            <label class="item-input-wrapper">                                <i class="icon ion-person"></i>                                <input type="text" name="user" id="user" ng-model="user" placeholder="用戶名" required>                                <div ng-show="myForm.user.$invalid && submitted">                                    <div style="color:red" ng-show="myForm.user.$error.required">用戶名是必須的</div>                                </div>                            </label>                        </div>                        <div class="item-input-inset">                            <label class="item-input-wrapper">                                <i class="icon ion-locked"></i>                                <input type="password" name="password1" ng-model="password1" required id="password1" placeholder="密碼">                                <div ng-show="myForm.password1.$invalid && submitted">                                    <div style="color:red" ng-show="myForm.password1.$error.required">密碼是必須的</div>                                </div>                            </label>                        </div>                        <div class="item-input-inset">                            <label class="item-input-wrapper">                                <i class="icon ion-locked"></i>                                <input type="password" name="password2" ng-model="password2" id="password2" required placeholder="確認密碼">                                <div ng-show="myForm.password2.$invalid && submitted">                                    <div style="color:red" ng-show="myForm.password2.$error.required">確認密碼是必須的</div>                                </div>                                <div ng-show="myForm.password2.$valid">                                    <div style="color:red" ng-show="password1!=password2">兩次密碼輸入不一致</div>                                </div>                            </label>                        </div>                    </div>                    <div class="padding">                        <button class="button button-full button-dark" type="submit">注冊</button>                    </div>        </form>    </div>      </ion-content>      </ion-nav-view> <script>      'use strict';     var myApp = angular.module('myApp',[]);  myApp.controller('myCtrl',['$scope', '$http',function($scope, $http){  // $scope.formModel = {};  $scope.submitted = false;  $scope.onSubmit = function(){    if ($scope.myForm.$valid) {        var param = {                User: $scope.user,                Pwd1: $scope.password1,                Pwd2:$scope.password2            }        $http.post('someurl',param)      .success(function(data){        console.log(':)');      })      .error(function(data){        console.log(':(');      });      console.log(param);}else{    $scope.submitted = true;}      }}]);    </script></body></html>不填寫信息注冊就會出現下圖:


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 国产一级一级 | 污黄视频在线播放 | 护士hd老师fre0性xxx | 欧美日韩大片在线观看 | 一本免费视频 | 国产不卡av在线 | 久青草免费视频 | 久久久久久久久久亚洲 | 成年人视频在线免费播放 | sese在线视频 | 黄色片视频观看 | 在线亚洲免费 | 国产精品视频自拍 | 欧美成人精品欧美一级乱黄 | 欧美日韩在线视频一区 | 伊久在线 | 国产资源在线视频 | 一级毛片免费高清视频 | 99热99精品 | 粉嫩粉嫩一区二区三区在线播放 | 国内精品视频饥渴少妇在线播放 | 黄色高清免费网站 | 久久成人免费观看 | 嫩草影院在线观看网站成人 | 一级做受毛片免费大片 | 九九热免费视频在线观看 | 草久免费 | 国产91久久精品一区二区 | 红杏亚洲影院一区二区三区 | 成人视屏网站 | 成人在线影视 | 欧美四级在线观看 | 人人看人人舔 | 亚洲骚图| 欧美激情999 | 性欧美xxxx免费岛国不卡电影 | 嫩草影院在线观看网站成人 | 亚洲午夜视频在线 | 欧美三日本三级少妇三级99观看视频 | 欧美黑人xx | 日韩色视频在线观看 |