angularjs--DOM
Posted 昱歌
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了angularjs--DOM相关的知识,希望对你有一定的参考价值。
angularjs--DOM
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> 6 <title>index</title> 7 <link href="{$Think.const.CSSURL}bootstrap.min.css" rel="stylesheet" type="text/css"/> 8 <script src="{$Think.const.JS}jquery.min.js" type="text/javascript"></script> 9 <script src="{$Think.const.JS}bootstrap.min.js" type="text/javascript"></script> 10 <script src="{$Think.const.JS}angular.min.js" type="text/javascript"></script> 11 <link href="{$Think.const.CSSURL}home/index.css" rel="stylesheet" type="text/css"/> 12 </head> 13 <body ng-app="myapp" ng-controller="myctrl"> 14 <div class="container"> 15 <h1 class="page-header">前端技术</h1> 16 17 <p> 18 <button class="btn btn-primary" ng-click="dis()">禁用</button> 19 </p> 20 <div class="form-group"> 21 <label for="">留言:</label> 22 <textarea class="form-control" ng-disabled="nd"></textarea> 23 </div> 24 25 <p> 26 <button class="btn btn-primary" ng-click="hide()">隐藏</button> 27 </p> 28 <div class="jumbotron" ng-hide="ns"> 29 <h1>jumborton</h1> 30 </div> 31 32 <img src="{$Think.const.HOMEIMG}/01.png" /> 33 </div> 34 </body> 35 <script> 36 app = angular.module("myapp",[]); 37 app.controller("myctrl",function($scope){ 38 39 $scope.dis = function(){ 40 $scope.nd = true; 41 } 42 43 $scope.hide = function(){ 44 $scope.ns = true; 45 } 46 47 }); 48 </script> 49 </html>
以上是关于angularjs--DOM的主要内容,如果未能解决你的问题,请参考以下文章