2017-01-03 4 views
1

Ich bekomme diese Warnung, wenn ich Schluck in der Befehlszeile Terminal laufen. Ich habe die Datei angular.js im HTML-Code hinzugefügt. Ich kann das Problem nicht lösen.Winkel ist nicht definiert

HTML-Code:

<!DOCTYPE html> 
<html lang="en" ng-app="confusionApp"> 

<head> 
    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <!-- The above 3 meta tags *must* come first in the head; any other head 
    content must come *after* these tags --> 
    <title>Ristorante Con Fusion: Menu</title> 
     <!-- Bootstrap --> 
    <!--build:css styles/main.css--> 
    <link href="../bower_components/bootstrap/dist/css/bootstrap.min.css"  rel="stylesheet"> 
    <link href="../bower_components/bootstrap/dist/css/bootstrap-theme.min.css" rel="stylesheet"> 
    <link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet"> 
    <link href="styles/bootstrap-social.css" rel="stylesheet"> 
    <link href="styles/mystyles.css" rel="stylesheet"> 
    <!--endbuild--> 
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> 
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> 
    <!--[if lt IE 9]> 
     <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> 
     <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> 
    <![endif]--> 
</head> 

<body> 

    <div class="container"> 
     <div class="row row-content" ng-controller="menuController as menuCtrl"> 
      <div class="col-xs-12"> 
       <ul class="nav nav-tabs" role="tablist"> 
       <li role="presentation"> 
        <a aria-controls="all menu" role="tab" ng-click="menuCtrl.select(1)" ng-class="{active:menuCtrl.isSelected(1)}">The Menu</a></li> 

       <li role="presentation"> 
        <a aria-controls="appetizer" role="tab" ng-click="menuCtrl.select(2)" ng-class="{active:menuCtrl.isSelected(2)}">Appetizers</a></li> 

       <li role="presentation"> 
        <a aria-controls="mains" role="tab" ng-click="menuCtrl.select(3)" ng-class="{active:menuCtrl.isSelected(3)}">Mains</a></li> 

       <li role="presentation"> 
        <a aria-controls="desserts" role="tab" ng-click="menuCtrl.select(4)" ng-class="{active:menuCtrl.isSelected(4)}">Desserts</a></li> 


       </ul> 

       <div class="tab-content"> 
       <ul class="media-list tab-pane fade in active"> 
       <li class="media" ng-repeat="dish in menuCtrl.dishes | filter:menuCtrl.filtText"> 
        <div class="media-left media-middle"> 
        <a href="#"><img ng-src={{dish.image}} class="media-object img-thumbnail" alt="Uthappizza"></a> 
        </div> 
        <div class="media-body"> 
        <h2 class="media-heading">{{dish.name}}</h2> 
         <span class="label label-danger label-xs">{{dish.label}}</span> 
         <span class="badge">{{dish.price | currency}}</span> 
         <p>{{dish.description}}</p> 

        </div> 

       </li> 
      </ul> 
        </div> 
      </div> 
     </div> 
    </div> 

    <!--build:js scripts/main.js--> 
    <script src="../bower_components/angular/angular.min.js"></script> 
    <script src="scripts/app.js"></script> 
    <!--endbuild--> 


</body> 

</html>` 

app.js Datei ist wie folgt:

/*jslint node: true */ 
'use strict'; 

angular.module('confusionApp',[]) 

     .controller('menuController',function(){ 

             this.tab=1; 
             this.filtText=""; 


             var dishes= 
               [ 
               { 
               name:'Uthapizza', 
               image:'images/uthapizza.png', 
               category:'mains', 
               label:'Hot', 
               price:'4.99', 
               description:'A unique combination of Indian Uthappam (pancake) and Italian pizza, topped with Cerignola olives, ripe vine cherry tomatoes, Vidalia onion, Guntur chillies and Buffalo Paneer.', 
               comment: '' 

               }, 
               { 

               name:'Zucchipakoda', 
               image: 'images/zucchipakoda.png', 
               category: 'appetizer', 
               label:'', 
               price:'1.99', 
               description:'Deep fried Zucchini coated with mildly spiced Chickpea flour batter accompanied with a sweet-tangy tamarind sauce', 
               comment: '' 

               }, 
               { 

               name:'Vadonut', 
               image: 'images/vadonut.png', 
               category: 'appetizer', 
               label:'New', 
               price:'1.99', 
               description:'A quintessential ConFusion experience, is it a vada or is it a donut?', 
               comment: '' 

               }, 
               { 
               name:'ElaiCheese Cake', 
               image: 'images/elaicheesecake.png', 
               category: 'dessert', 
               label:'', 
               price:'2.99', 
               description:'A delectable, semi-sweet New York Style Cheese Cake, with Graham cracker crust and spiced with Indian cardamoms', 
               comment: '' 

               } 
               ]; 
            this.dishes=dishes; 


            this.select=function(settab){ 

             this.tab=settab; 

             if(settab===2){ 
              this.filtText="appetizer"; 
             } 
             else if(settab===3){ 
              this.filtText="mains"; 
             } 
             else if(settab===4){ 
              this.filtText="dessert"; 
             } 
             else{ 
              this.filtText=""; 
             } 
            }; 

            this.isSelected=function(checktab){ 

             return(this.tab===checktab); 
            }; 



     }); 

`

this is the error when I run gulp in command line prompt

+0

Aufruf 'angular' Skript an der Spitze der den anderen Scripts –

+0

Welche Aufgabe schluck den Fehler gemeldet? War es Eslint oder andere statische Überprüfung? –

+0

Dies ist nur eine Schluckwarnung. Ihre app.js-Datei kennt die Variable "angular" nicht. Sie können entweder die Warnung ignorieren, oder konfigurieren Sie Schluck, so dass es von eckigen kennt – devqon

Antwort

0

Bewegen Sie AngularJS nach innen HEAD-Tag von BODY-Datei. Es wird gut funktionieren.

+0

Ich habe das versucht, aber es hat nicht funktioniert – Radhika

+0

Wie hast du all diese _bower_components_ installiert? By_bower install_ oder Sie haben es gerade von Websites heruntergeladen? –

+0

Ich habe es mit bower installieren - alle Komponenten sind dort in bower Ordner – Radhika

0

Yor Fehler zeigt in Zeile Nr. 5, aber Ihre ursprüngliche Datei zeigt Winkel Referenz in eine andere Zeile.

(i) Versuchen Sie, die App erneut auszuführen.

(ii) Überprüfen Sie die Netzwerkregisterkarte in Chrome, wenn die Winkelreferenz korrekt geladen ist.

Wenn nicht ändern Sie den Pfad, um korrekt zu sein und den Test erneut durchzuführen.

-1

Eckige muss jQuery, könnte diese als gut zB enthalten sein sollen.

<script 
    src="https://code.jquery.com/jquery-3.1.1.min.js" 
    integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" 
    crossorigin="anonymous"></script> 

Stellen Sie sicher, es sind, bevor Sie die Schräg-Dateien enthalten

+0

hat nicht funktioniert. Danke für die Hilfe – Radhika

0

Ich habe versucht, nach dem ‚use strict‘ in app.js Entfernen Datei und es hat für mich funktioniert.

Verwandte Themen