这是我的表格:
<form ng-show="skm" class="form-inline editable-wrap editable-text ng-scope ng-pristine ng-valid ng-valid-required" role="form">
<input type="text" ng-model="doc" placeholder="Field:">
<button type="submit">Ok</button>
</form>
我希望在下面form
上click
时显示此button
:
<a tooltip="Add more" href="javascript:void(0);" class="plus" ng-model ="skm"><i class="icon-plus"></i></a>
答案 0 :(得分:1)
如果您尝试使用控制器的功能,那么这是一个选项 像这样设置你的模块和控制器..
angular.module("my_app",[])
.controller("my_ctr",function($scope){
$scope.skm=false;
$scope.mmmmmm=function()
{
if($scope.skm==false)
{
$scope.skm=true;
}
else
{
$scope.skm=false;
}
}
})
<body ng-app="my_app" ng-controller="my_ctr">
<button ng-click="mmmmmm()">hii</button>
<form ng-model="frm" ng-show="skm" class="form-inline editable-wrap editable-text ng-scope ng-pristine ng-valid ng-valid-required" role="form">
<input type="text" ng-model="doc" placeholder="Field:">
<button type="submit">Ok</button>
</form>
</body>
我希望你的怀疑是明确的。
答案 1 :(得分:0)
您所指的是ngShow和ngHide
阅读本文
<div ng-app>
<a tooltip="Add more" ng-click="showForm = !showForm" href="javascript:void(0);" class="plus" ng-model="skm" >
<i class="icon-plus"></i>
</a>
<form ng-show="showForm" class="form-inline editable-wrap editable-text ng-scope ng-pristine ng-valid ng-valid-required" role="form">
<input type="text" ng-model="doc" placeholder="Field:">
<button type="submit">Ok</button>
</form>
</div>
工作示例