2016-10-27 1 views
0

Je l'extrait de code suivant dans un seul fichier et je reçois le Erro suivant:onglet Interface angulaire directive personnalisée a des problèmes de modèle

Template for directive 'uibTabset' must have exactly one root element /my-tabs.html

<script type="text/ng-template" id="/my-tabs.html</script> 
 
            .. 
 
            
 
<script type="text/javascript"> 
 
     angular.module('checkinapp', ['ngAnimate', 'ui.bootstrap']); 
 
     angular.module('checkinapp').controller('TabsDemoCtrl', function($scope, $window) { 
 
      // or here... $scope.indextab = 1 
 
     }); 
 
     </script> 
 
           
 
.... 
 
<section class="my-tabs" ng-controller="TabsDemoCtrl" ng-init="indextab = 1"> 
 
\t \t \t \t \t <uib-tabset active="indextab" template-url="/my-tabs.html"> 
 
\t \t \t \t \t \t <uib-tab index="0" heading="Static title" class="col-xs-4 col-sm-4 col-md-4 col-lg-4">Static First</uib-tab> 
 
\t \t \t \t \t \t <uib-tab index="1" heading="Static title1" class="col-xs-4 col-sm-4 col-md-4 col-lg-4">Static Second</uib-tab> 
 
\t \t \t \t \t \t <uib-tab index="2" heading="Static title2" active="true" class="col-xs-4 col-sm-4 col-md-4 col-lg-4">Static Third</uib-tab> 
 
\t \t \t \t \t </uib-tabset> 
 
\t \t \t \t </section>

Comment est-ce que je le résous?

Merci

Répondre

0

Changer

<script type="text/ng-template" id="/my-tabs.html</script> 
... 
<uib-tabset active="indextab" template-url="/my-tabs.html"> 

à

<script type="text/ng-template" id="my-tabs.html"> 
    <div>fill your template here</div> 
</script> 
... 
<uib-tabset active="indextab" template-url="my-tabs.html"> 
+0

Ce ne fonctionne pas dans mon NPM mis en place l'application. Aucune erreur n'a été levée, mais l'URL de modèle ne se charge pas! :( – Smitha

+0

Pouvez-vous élaborer? –

+0

Je ne suis pas sûr, combien je peux être précis en expliquant ceci.Quand j'intègre ce qui précède sur un écran différent, sans balises html, (quand je le charge en ui-vue), je ne obtenir le modèle personnalisé chargé. – Smitha