您好,我是 Framework7 的新手,我正在尝试将数据绑定与 AngularJS 一起使用,但我似乎无法让它工作。我只是试图将控制器中的名称绑定到我的 HTML,但我想我做错了什么......在我的两段代码下面。
<div class="pages navbar-through toolbar-through" ng-controller="DemoController">
<!-- Page, data-page contains page name-->
<div data-page="index" class="page">
<!-- Scrollable page content-->
<div class="page-content">
<div class="content-block-title">Welcome To My Awesome App</div>
<div class="content-block">
<div class="content-block-inner">
<p>Couple of worlds here because my app is so awesome!</p>
<p>Duis sed erat ac eros ultrices pharetra id ut tellus. Praesent rhoncus enim ornare ipsum aliquet ultricies. Pellentesque sodales erat quis elementum sagittis.</p>
</div>
</div>
<div class="content-block-title">What about simple navigation?</div>
<div class="list-block">
<ul>
<li><a href="about.html" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title">{{ name }}</div>
</div>
</div></a></li>
<li><a href="services.html" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title">Services</div>
</div>
</div></a></li>
<li><a href="form.html" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title">Form</div>
</div>
</div></a></li>
</ul>
</div>
<div class="content-block-title">Side panels</div>
<div class="content-block">
<div class="row">
<div class="col-50"><a href="#" data-panel="left" class="button open-panel">Left Panel</a></div>
<div class="col-50"><a href="#" data-panel="right" class="button open-panel">Right Panel</a></div>
</div>
</div>
</div>
</div>
</div>
<script>
function DemoController($scope)
{
$scope.name = "Dieter";
$scope.toggle = function(){
$scope.visible = !$scope.visible;
};
$scope.visible = true;
}
</script>