试试我这个例子,有不明白的再问 hello var app = angular.module('test', []); app.controller('showCtrl', function($scope, $window){ //默认展示 $scope.checked = true; });
试试我这个例子,有不明白的再问 hello var app = angular.module('test', []); app.controller('showCtrl', function($scope, $window){ //默认展示 $scope.checked = true; });
在具体内容加上ng-hide 如 内容
show、ng-hide、ng-if指令都可以用来控制dom元素的显示或隐藏。ng-show和ng-hide根据所给表达式的值来显示或隐藏HTML元素。当赋值给ng-show指令的值为false时元素会被隐藏,值为true时元素会显示。ng-hide功能类似,使用方式相反。元素的显示或.
Click me: I show up when your checkbox is checked. I hide when your checkbox is checked. var myApp = angular.module('myApp', []); function MyCtrl($scope) { }
为什么都不搜一下呢 比如this is a div which is show 你设置isShow为true则显示,设置为false则隐藏 ng-hide用法相同,效果相反
print? 2 + 2 isn’t 5, don’t show 2 + 2 is 4, do show [javascript] view plain copy print? 2 + 2 isn't 5, don't
显示/隐藏 app.controller('myController',function($scope){ $scope.isShow=true; $scope.onClick=function(){ $scope.isShow=!$scope.isShow; } })