當我在命令行終端中運行gulp時,出現此警告。 我在HTML代碼中添加了angular.js文件。我無法弄清楚這個問題。未定義角度
HTML代碼:
<!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文件如下:
/*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
在其他腳本頂部調用'angular'腳本 –
哪個gulp任務報告了錯誤?是eslint還是其他靜態檢查? –
這只是一個吞嚥警告。你的app.js文件不知道變量'angular'。你可以忽略警告,或配置吞嚥,所以它知道的角 – devqon