zoukankan      html  css  js  c++  java
  • AngularJs练习Demo4

     1 @{
     2     Layout = null;
     3 }
     4 
     5 <!DOCTYPE html>
     6 
     7 <html>
     8 <head>
     9     <meta name="viewport" content="width=device-width" />
    10     <title>Input</title>
    11     <script type="text/javascript" src="~/Scripts/angular.js"></script>
    12 </head>
    13 <body>
    14     <div ng-app="myApp">
    15         <div ng-controller="firstController">
    16             <input type="button" ng-value="text" ng-disabled="isDisabled" />
    17             <input type="text" value="{{text}}" ng-readonly="isDisabled" />
    18             <input type="checkbox" value="{{text}}" ng-checked="isDisabled" />
    19         </div>
    20     </div>
    21     <script type="text/javascript">
    22         var app = angular.module("myApp", []);
    23         app.controller("firstController", function ($scope,$interval) {
    24           //  $scope.text = "phoneGap中文网";
    25             $scope.isDisabled = true;
    26             $scope.n = 5;
    27             $scope.text = $scope.n + '秒';
    28           var time=$interval(function () {
    29               $scope.n--;
    30               $scope.text = $scope.n + '秒';
    31               if ($scope.n == 0)
    32               {
    33                   $interval.cancel(time);
    34                   $scope.text = "可以点击了";
    35                   $scope.isDisabled = false;
    36               }
    37             },1000)
    38         });
    39     </script>
    40 </body>
    41 </html>
  • 相关阅读:
    Nginx+Lua学习笔记-环境搭建
    Scala学习笔记-Servlet环境搭建
    Scala学习笔记-环境搭建以及简单语法
    Python v3.4 not found的解决方法
    【闲聊】最近一段时间的总结
    javassist初接触
    java调用cmd
    Flexpaper初接触
    Derby初接触
    LVS Keepalived 集群
  • 原文地址:https://www.cnblogs.com/sumg/p/5605342.html
Copyright © 2011-2022 走看看