AngularJs练习Demo4
Posted 编程猴子
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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>
以上是关于AngularJs练习Demo4的主要内容,如果未能解决你的问题,请参考以下文章
从 AngularJS url 中删除片段标识符(# 符号)