前端之家收集整理的这篇文章主要介绍了
angular之单选框与ng-show,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<!DOCTYPE html> <html> <head> <Meta charset="UTF-8"> <title></title> <script src="https://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script> </head> <body> <div ng-app="hd" ng-controller="ctrl"> 网站开启关闭 <input type="radio" ng-model="status" value="1"/>开启 <input type="radio" ng-model="status" value="0"/>关闭 {{status}} <div ng-show="status==0"> <h2>关闭原因:</h2> <textarea name="" rows="" cols=""> 后盾网后台维护中~~~ </textarea> </div> </div> <script type="text/javascript"> var m=angular.module("hd",[]); m.controller("ctrl",['$scope',function($scope){ $scope.status=1; }]); </script> </body> </html>