如何用手风琴添加表格。

时间:2016-01-05 08:41:54

标签: angularjs twitter-bootstrap

我是新的角度,当用户点击手风琴标题然后手风琴身体显示form.rather而不是显示身体中的html代码。我正在添加表格标签是正确的方式我跟随如果其他请让我知道。提前致谢。                                             

<div ng-controller="AccordionDemoCtrl">
<label class="checkbox">
<input type="checkbox" ng-model="oneAtATime">
    Open only one at a time
</label>

<accordion close-others="oneAtATime">
<accordion-group heading="Static Header">
      This content is straight in the temmplate.
</accordion-group>
<accordion-group heading="{{group.title}}" ng-repeat="group in groups">
      {{group.template}}
</accordion-group>
<accordion-group heading="Dynamic Body Content">
<p>The body of the accordion group grows to fit the contents</p>
<button class="btn btn-small" ng-click="addItem()">Add Item</button>
<div ng-repeat="item in items">{{item}}</div>
</accordion-group>
</accordion>
</div>
</body>
<script>
angular.module('pl', ['ui.bootstrap']);
function AccordionDemoCtrl($scope) {
$scope.oneAtATime = true;

$scope.groups = [
{
title: "Member application",
template: '<form><input type="text"></form>'
},
{
title: "Contact us",
template:'<form> <input type="text"><input type="password"> </form>'   
}
];

$scope.items = ['Item 1', 'Item 2', 'Item 3'];

$scope.addItem = function() {
var newItemNo = $scope.items.length + 1;
$scope.items.push('Item ' + newItemNo);
};
}

</script>
</html>

0 个答案:

没有答案