繁体   English   中英

渲染部分文件AngularJS

[英]Render Partial File AngularJS

我有以下代码,我想在选项卡中呈现我的部分文件。

在我的service.html中

<html ng-app="ui.bootstrap.demo">
  <head>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.12.1.js"></script>
    <script src="app.js"></script>
    <script src="example.js"></script>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body>

<div ng-controller="TabsDemoCtrl">


  <tabset>
    <tab heading="Justified"><div ng-include src="sunday.html"></div></tab>
    <tab heading="SJ"><div ng-include src="monday.html"></div></tab>
    <tab heading="Long Justified">Long Labeled Justified content</tab>
  </tabset>
</div>
  </body>
</html>

在我的app.js中,我使用以下代码

angular
  .module('letsSchedulecommyApp', [
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ui.bootstrap',
    'ui.calendar',
    'ngSanitize',
    'ui.router'
  ])
  .config(function ($routeProvider) {
    $routeProvider
      .when('/', {
        templateUrl: 'views/cleaning_services/homepage.html',
        controller: 'CleaningServicesCtrl'
      })
      .when('/maid-cleaners', {
        templateUrl: 'views/cleaning_services/maid_cleaning_service.html',
        controller: 'CleaningServicesCtrl'
      })
      .otherwise({
        redirectTo: '/'
      });

  });

这是我的plunkr文件http://plnkr.co/edit/PgXGQFe8mDJ1lDkpEqrx

所以基本上,我想单击选项卡,然后查看渲染的部分文件。

任何帮助表示赞赏。

NG-包括SRC应该是'单qoute,添加ng-view得到页面上查看角$路由意见。

的HTML

<div ng-controller="TabsDemoCtrl">
  <tabset>
    <tab heading="Justified"><div ng-include src="'sunday.html'"></div></tab>
    <tab heading="SJ"><div ng-include src="'monday.html'"></div></tab>
    <tab heading="Long Justified">Long Labeled Justified content</tab>
  </tabset>
  <div ng-view>
  </div>
</div>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM