현재 앵귤러 JS가 표시되는 데 문제가 있습니다. 브라우저에서 일반 텍스트로만 표시되고 정보가 전달되지 않으므로 잘못된 작업을하고 있는지 잘 모르겠습니다. app2.js
에서
모든 코드가 내 코드에 나열된 위치에 올바르게 배치되어 있으므로 코드에 오류가있을 수 있습니다.
내 코드는 다음과 같습니다.AngularJS가 일반 텍스트로 표시됩니다.
var app = angular.module('phonecatApp', ['ui.bootstrap']);
을하고 phonecatApp
모듈 컨트롤러 정의됩니다
<!DOCTYPE html>
<html ng-app="phonecatApp" lang="en">
<head>
<title></title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="PhoneCat">
<!-- AngularUI Styles -->
<link rel="stylesheet" href="Content/ui-bootstrap-csp.css" />
</head>
<p>Total number of phones: {{phones.length}}</p>
<body ng-controller="PhoneListController">
<ul>
<li ng-repeat="phone in phones">
<span>{{phone.name}}</span>
<p>{{phone.snippet}}</p>
</li>
</ul>
</body>
<script src="scripts/angular.js"></script>
<script src="scripts/angular-ui/ui-bootstrap-tpls.min.js"></script>
<script src="scripts/app2.js"></script>
</html>
는 app
로 모듈을 정의
// Define the `phonecatApp` module
var app = angular.module('phonecatApp', ['ui.bootstrap']);
// Define the `PhoneListController` controller on the `phonecatApp` module
phonecatApp.controller('PhoneListController', function PhoneListController($scope) {
$scope.phones = [
{
name: 'Nexus S',
snippet: 'Fast just got faster with Nexus S.'
}, {
name: 'Motorola XOOM™ with Wi-Fi',
snippet: 'The Next, Next Generation tablet.'
}, {
name: 'MOTOROLA XOOM™',
snippet: 'The Next, Next Generation tablet.'
}
];
});
스크립트 태그가 닫히지 않아 .. 아니면 그저 오타입니다 ..? –
모든 콘솔 오류가 있습니까? – Dieterg
app2.js 5 catch되지 ReferenceError가 : phonecatApp – Auborey