각도와 부트 스트랩을 사용하는 단일 페이지 응용 프로그램에서 작업하고 있습니다.각도보기가 각도로 작동하지 않습니다.
<!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">
<title>Ristorante Con Fusion</title>
<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 -->
</head>
<body>
<header class="jumbotron">
<!-- Main component for a primary marketing message or call to action -->
<div class="container">
<div class="row row-header">
<div class="col-xs-12 col-sm-8">
<h1>Ristorante con Fusion</h1>
<p style="padding:40px;"></p>
<p>We take inspiration from the World's best cuisines, and create
a unique fusion experience. Our lipsmacking creations will
tickle your culinary senses!</p>
</div>
</div>
</div>
</header>
<ng-view></ng-view>
<footer class="row-footer">
</div>
</footer>
<!-- build:js scripts/main.js -->
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-route/angular-route.min.js"></script>
<script src="scripts/app.js"></script>
<script src="scripts/controllers.js"></script>
<script src="scripts/services.js"></script>
<!-- endbuild -->
</body>
</html>
여기 내 app.js
'use strict';
angular.module('confusionApp', ['ngRoute']){
.config(function($routeProvider){
$routeProvider
.when('/contactUs',{
templateUrl:'contactUs.html'
controller :'ContactController'
})
.when('/menu',{
templateUrl:'menu.html'
controller :'MenuController'
})
.when('/menu/:id',{
templateUrl:'dishdetail.html'
controller :'DishDetailController'
})
.otherwise('/contactUs');
})
};하지만 NG-보기
index.html을 된 index.html에 부착되지 않는다
여기 여기 내 controller.js
.controller('DishDetailController', ['$scope','menuFactory','$routeParams', function($scope,menuFactory,$routeParams) {
$scope.dish= menuFactory.getDish(parseInt($routeParams.id,10));
}])
.controller('DishCommentController', ['$scope', function($scope) {
//Step 1: Create a JavaScript object to hold the comment from the form
$scope.isSelected=function(checkStar){
console.log(checkStar==5);
return checkStar==5;
};
$scope.stars=stars;
$scope.comment={name:"",rating:"5",textComments:"",date:""};
}])
의 내 service.js
'use strict';
angular.module('confusionApp')
.service('menuFactory',function(){
var dishes=[
{
_id=0,
comments: [
{
rating:5,
comment:"Imagine all the eatables, living in conFusion!",
author:"John Lemon",
date:"2012-10-16T17:57:28.556094Z"
},
]
},
{
_id=1,
comments: [
{
rating:4,
comment:"Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
author:"Paul McVites",
date:"2014-09-05T17:57:28.556094Z"
},
{
rating:2,
comment:"It's your birthday, we're gonna party!",
author:"25 Cent",
date:"2011-12-02T17:57:28.556094Z"
} ]
}];
this.getDishes = function(){
return dishes;
};
this.getDish = function (index) {
return dishes[index];
};
}
);
;
그리고 내 index.html을 내가 같은
실제 html을 포함하십시오. – ryanyuyu
그것은 하나의 커다란 벽입니다! 나는 그것을 감소시킬 것이다 [mcve] (http://stackoverflow.com/help/mcve). 그리고 그때까지 문제를 발견하지 못했다면 여기에서 좋은 대답을 얻을 가능성이 훨씬 더 높습니다. (그리고 당신의 질문은 미래의 방문자에게 더 유용 할 것입니다.) 나는 그 길을 따라가는 길을 파지 않을 것입니다. 그게 확실한거야 ... – Pevara
그래서 첫 번째 단계에 오기 전에 심지어 인터넷 검색 : 브라우저의 디버그 콘솔을 엽니 다. 그렇게하면 도움이 될 것이며, 해결할 수 없다면 우리에게 메시지를 보내면 우리에게 도움이 될 것입니다. – Walfrat